Skip to content

Charts options#3036

Merged
offtherailz merged 21 commits intogeosolutions-it:masterfrom
baloola:charts_options
Aug 9, 2018
Merged

Charts options#3036
offtherailz merged 21 commits intogeosolutions-it:masterfrom
baloola:charts_options

Conversation

@baloola
Copy link
Copy Markdown
Contributor

@baloola baloola commented Jun 28, 2018

Description

A few sentences describing the overall goals of the pull request' s commits.

Issues

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

What is the current behavior? (You can also link to an open issue here)
see 2654 for details

What is the new behavior?
added a collapse panel with advanced options, enables to 1.hide the grid. 2. hide y axis (shown b default) 3. add a y axis label

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes
  • No

If this PR contains a breaking change, please describe the impact and migration path for existing applications: ...

Other information:

@ghost ghost assigned baloola Jun 28, 2018
@tdipisa tdipisa requested a review from offtherailz June 28, 2018 12:09
"pie": "Mostra legenda",
"bar": "Mostra legenda",
"gauge": "Mostra etichette"
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use google translate for the translations for it, es, fr, de
the other languages you can leave english

"displayCartesian": {
"line": "Hide Grid",
"bar": "Hide Grid"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove an extra empty line

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please, remove the white line. We should keep the same line numbers in all translation files

@@ -0,0 +1,16 @@
const React = require('react');

const AxisLabel = ({ axisType, x, y, width, height, stroke, children }) => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add documentation please

Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • add/create/modify unit tests to check your changes to the code
  • The vertical Y axis you added looks good, but sometimes doesn't fit. It is better to remove it.
  • The custom Y axis label should be the one in the screenshot:
    image
  • Please remember to replace the Y axis name even in the table column
    image
    image
  • When you edit an existing widget, the advanced option panel don't display Y axis label
    issue_advanced_options

"displayCartesian": {
"line": "Hide Grid",
"bar": "Hide Grid"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes please, remove the white line. We should keep the same line numbers in all translation files

@@ -0,0 +1,39 @@
/* chart advance options */
Copy link
Copy Markdown
Member

@offtherailz offtherailz Jun 28, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order to avoid the creation of too mani less files, you should move this into the widget.less, under the section "BUILDER"

@geosolutions-it geosolutions-it deleted a comment Jul 8, 2018
@coveralls
Copy link
Copy Markdown

coveralls commented Jul 8, 2018

Coverage Status

Coverage increased (+0.01%) to 80.87% when pulling f6a745d on baloola:charts_options into 6727203 on geosolutions-it:master.

Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Y axis numbers option must be present
  • Also the chart legend should be replaced with the custom label
    image

@ghost ghost assigned offtherailz Jul 17, 2018
Copy link
Copy Markdown
Member

@offtherailz offtherailz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still a lot of issues:

  • When I create a new chart, when I open the advanced options panel I can not see the same settings I see in the preview:
    • hide grid is on, but the grid is visible.
    • hide y axis is switched off, so I should see the labels, but I can't.
  • Changing the label text with display legend turned on do not change the legend in the preview chart.

image

  • also that you named "label" the y axis presence flag, and "yAxisLabel" the label value in options.
    Please rename variables accordingly to their purpose.
  • I see WPSWidgetOptions is not well formatted (from line 164 is very confusing) . Please make it readable

@baloola
Copy link
Copy Markdown
Contributor Author

baloola commented Jul 25, 2018

regarding " Changing the label text with display legend turned on do not change the legend in the preview chart ".
To do it re-actively, the chart needs to be re-loaded every time the text is changed (every time a letter is typed/removed). Is this practical for charts with large data?

@offtherailz
Copy link
Copy Markdown
Member

You shouldn't reload the chart if you're changing the
There is a function that triggers the data load.
https://github.com/geosolutions-it/MapStore2/pull/3036/files#diff-d6c1acae2c933610048606103f25c4b7R35
I think this causes the reload on label change. Modify the checks accordingly to avoid data load not required.

@baloola
Copy link
Copy Markdown
Contributor Author

baloola commented Jul 26, 2018

would a submit button, that onSubmit changes the label state work? something that has the massage "insert " for example?

@offtherailz
Copy link
Copy Markdown
Member

offtherailz commented Jul 26, 2018

No, take a look on how it is implemented for unit of measure in the counter widget. It is interactive and it should be the same.
image

By the way, I noticed another couple of things. I updated the review with these points

</FormGroup> : null}
</Form>

{formOptions.advancedOptions && data.type === "bar" || data.type === "line" ?
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please format it better

@offtherailz offtherailz merged commit 74d112a into geosolutions-it:master Aug 9, 2018
@baloola baloola deleted the charts_options branch August 9, 2018 10:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Widgets: Advanced chart options

4 participants