Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chart improvements #989

Merged
merged 25 commits into from
Oct 2, 2018
Merged

Chart improvements #989

merged 25 commits into from
Oct 2, 2018

Commits on Oct 2, 2018

  1. Configuration menu
    Copy the full SHA
    898efcb View commit details
    Browse the repository at this point in the history
  2. Resort methods in DataDisplay

    Move react state methods up.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    ba002c3 View commit details
    Browse the repository at this point in the history
  3. No need to put hasSvg into the DataDisplay state

    hasSvg can always be derived in render.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    3bdb9d7 View commit details
    Browse the repository at this point in the history
  4. Allow to toggle the Legend in children of DataDisplay

    Add icon to toggle displaying the legend of charts.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    ddd7416 View commit details
    Browse the repository at this point in the history
  5. Use DataDisplay icons prop as render props

    Allow to override the icon prop of DataDisplay to render different icons
    for a chart.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    4423392 View commit details
    Browse the repository at this point in the history
  6. Add a chartState to DataDisplay

    Allow to set and get state for charts in DataDisplay. Setting the state
    will also re-render the children which wouldn't be possible if a chart
    keeps the state internally in it's component. At a first step the
    showLegend state is put into the chart state.
    
    In future this chart state will be saved in the redux store too.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    32cfade View commit details
    Browse the repository at this point in the history
  7. Move MENU_PLACEHOLDER_WIDTH to a new js module

    Chart modules should not depend on dashboard components. Charts
    components are only for displaying some data and dashboards for
    orchestrating different displays which might be charts.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    b16d763 View commit details
    Browse the repository at this point in the history
  8. Add a default shouldUpdate implementation for charts

    Charts must be updates at least if data, width or height props have
    changed.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    377f808 View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    49d243f View commit details
    Browse the repository at this point in the history
  10. Fix indentation

    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    1c72750 View commit details
    Browse the repository at this point in the history
  11. Use showLegend prop to toggle displaying chart Legends

    Rename displayLegend of Bar chart to showLegend and add showLegend to
    Donut chart.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    b483e9e View commit details
    Browse the repository at this point in the history
  12. Fix calculating the Bar chart width with Legend displayed

    If the legend is displayed the Bar chart must be rendered again after
    the ref is set.
    
    Also update chart to use new React.createRef API.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    8062970 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    36ed925 View commit details
    Browse the repository at this point in the history
  14. Move LineChart proptypes to the bottom

    We have mostly all proptypes at the bottom of the js module. Therefore
    it's demanding to search for the LineChart proptypes.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    b67033e View commit details
    Browse the repository at this point in the history
  15. Rename displayLegend into showLegend

    Use showLegend prop instead of displayLegend at LineChart.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    bc3271a View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    f49f80a View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    bf2d14a View commit details
    Browse the repository at this point in the history
  18. Avoid crashing DataDisplay on svg download

    Never crash if svg or download refs aren't set. This should not ever
    happen but it is saver to check for this case.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    1dc6076 View commit details
    Browse the repository at this point in the history
  19. Fix displaying the svg download icon

    When the svg ref is set in a child of DataDisplay the component will not
    be re-rendered necessarily. Therefore the svg ref may be set but the
    icon is still not displayed. Therefore add an external prop to
    deactivate the svg download icon on demand.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    041ead1 View commit details
    Browse the repository at this point in the history
  20. Disable svg downloads for data table displays

    When displaying a table it shouldn't be possible to download a svg.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    c01917f View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    274deff View commit details
    Browse the repository at this point in the history
  22. Fix LineChart update

    Only re-calculate state from width if the width has changed actually. Th
    LineChart did crash because the width has been re-calculated when
    hovering over the LineChart to display the tooltips. This lead to an
    infinite loop.
    
    Also fix calculation of the width. It uses the same pattern as the donut
    chart now.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    db73eef View commit details
    Browse the repository at this point in the history
  23. Update shouldUpdate to consider showLegend prop

    A chart should be re-rendered if the showLegend prop has changed.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    741028d View commit details
    Browse the repository at this point in the history
  24. Configuration menu
    Copy the full SHA
    9ae37ac View commit details
    Browse the repository at this point in the history
  25. Rename chart state to child state

    Use initialState instead of initialChartState because the internal state
    variable name isn't visible outside of DataDisplay component. For
    children it's only the state.
    bjoernricks committed Oct 2, 2018
    Configuration menu
    Copy the full SHA
    ed66c95 View commit details
    Browse the repository at this point in the history