Skip to content

DM-6286 Charts Container #216

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

Merged
merged 6 commits into from
Nov 2, 2016
Merged

DM-6286 Charts Container #216

merged 6 commits into from
Nov 2, 2016

Conversation

tgoldina
Copy link
Contributor

The major classes - MultiChartViewer, MultiChartToolbar

Also refactored charts display. ChartPanel.jsx is now generic and gets info via chartType.
See chartTypes/HistogramTblView and chartTypes/ScatterTblView

Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

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

Demo's Deprecated API plot no longer works. It is working on irsawebdev.
Beside this, the other comments are either questions or suggestions. No action is expected.

}
}

function renderToolbar(chartId, expandable, expandedMode, toggleOptions) {
Copy link
Contributor

@loitly loitly Oct 31, 2016

Choose a reason for hiding this comment

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

Just a thought...
These render* functions are basically react's functional components. Would it be better written as such? ie.
Toolbar({chartId, expandable, expandedMode, toggleOptions})
usage:

const {Toolbar, Options} = HISTOGRAM_TBLVIEW;
<Toolbar />
<Options />

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I did make Chart, Toolbar, and Options functional components first, but then I wanted to switch to non-functional component for one chart type, and realized I can not pass it as a function anymore. May be it's not a big deal, and the recipe would be wrapping it into a functional component.

<div className='PanelToolbar_group'>
{renderSelectionButtons(chartId, tblId, tableModel)}
</div>
<div className='PanelToolbar_group'>
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you mean to use 'PanelToolbar__group'(double underscores).


import * as ChartsCntlr from '../ChartsCntlr.js';

class ChartPanelView extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider exposing ChartPanelView if it can be used separately without ChartPanel.
If so, it should be in its own file.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a use case for ChartPanelView alone? It my help be to know so I can see the reuse better.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The only use case I can think of is a chart, which has no dependency on the redux store and is not part of any multi-chart viewer. In this case, I think I should move dispatchChartMount/Unmount from ChartPanelView component to ChartPanel.

);
})}
</div>
const {chartId, expandedMode, closeable} = this.props;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't quite get the purpose of this component. It's a simple wrapper around ChartPanel and MultiChartViewer without any added logic of its own. When do we use this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This component handles single chart display from API (both standard and expanded mode) and wraps the default MultiChartViewer. Perhaps, at some point it can be eliminated, but I like to have this wrapper so that only chart code changes when chart code is refactored.

Copy link
Contributor

@robyww robyww left a comment

Choose a reason for hiding this comment

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

UI Notes:

  • When expanded the close button should be all the way left
  • I think the delete plot 'x' should be on each plot

Overall it look really good.

renderToolbar,
getChartProperties,
updateOnStoreChange
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a typedef for what goes into this object?


import * as ChartsCntlr from '../ChartsCntlr.js';

class ChartPanelView extends Component {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a use case for ChartPanelView alone? It my help be to know so I can see the reuse better.

<PagingControl activePlotId={activePlotId}
visRoot={visRoot}
expandedMode={expandedMode} />
<PagingControl
Copy link
Contributor

Choose a reason for hiding this comment

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

You might want to break PagingControl into is own file.

- Moved 'Close' button to the extreme left
- Chart remove icon is now on the chart
- Use Chart, Options, Toolbar functional components instead of renderChart, renderOptions, renderToolbar
Copy link
Contributor

@loitly loitly left a comment

Choose a reason for hiding this comment

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

Looks great!

@tgoldina tgoldina merged commit f2d57a5 into dev Nov 2, 2016
@tgoldina tgoldina deleted the dm-6286_charts_container branch November 4, 2016 20:44
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.

3 participants