-
Notifications
You must be signed in to change notification settings - Fork 180
Closed
Description
Issue for tracking technical decisions and progress.
To accomplish #756 and connected issues, we need first to pull top-panel into visualisation itself. To do this, we need to clean up code around BaseVisualization.
- First step is to remove
BaseVisualizationas a base class. Composition, not encapsulation
- Remove scroll state from
BaseVisualization. Different visualisations use scroll differently and they should be responsible to track this. For exampleTableis not interested in horizontal scroll at all. Move scroll state to specific visualisations #775 - Remove
dragOnSeriesfrom state. It is not used. Remove old and unused code #776 - Create component for managing
highlight. It would keepHighlightstate and provide useful callbacks/getters HighlightController #777 - Extract data fetching into separate component. Visualisation can provide query function and/or
shouldRefetchDatapredicate. Component will render error and loading states and provide to visualisation data as props iff in loaded state. DataProvider #779
- We need to clean up components in top-panel.
- Remove references to Components. All communication should be done through props and/or state. "Dirty" tiles should be added to
Essence. It is ephemeral state, not persisted into url/view definition and can be reset when reconstructingEssencePartial Tiles #780
- All generic solution will be encapsulated in
CenterPanelcomponent with following props:
visualisation- Component for rendering chart. Get's few props likedata,highlightetc.topMenu- Component for rendering top menu - splits, filters etc.shouldFetchData- predicate for deciding if props change constitute data refetch. Optional.makeQuery- function that creates Plywood query fromEssence. Optional.
- All Visualizations will use
CenterPanelcomponent and provide props. For LineChart I imagine something like this:
function LineChartVisualization() {
return <CenterPanel
visualisation={LineChart}
topMenu={LineChartTopMenu}
shouldFetchData={Essence.equals}
/>;
}Because JSX invocation can also take render prop, we are free to customise existing components even if signature does not fit, like visualisation={({data, highlight}) => <LineChart series={data[0]} hasHighlight={highlight.hasHighlight()} changeHighlight={highlight.setNewHighlight} />
Metadata
Metadata
Assignees
Labels
No labels