Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

Use new viz instance when component updates #32

Closed
wants to merge 1 commit into from

Conversation

stereobooster
Copy link
Contributor

@stereobooster stereobooster commented Mar 22, 2019

Without this change I got an error when switch between different visualisations of Grid:

axes_manager.js:82 Uncaught Error: The following axes have not been configured: x2
    at AxesManager.../../node_modules/@operational/visualizations/lib/Chart/axes_manager.js.AxesManager.updateAxes (axes_manager.js:82)
    at AxesManager.../../node_modules/@operational/visualizations/lib/Chart/axes_manager.js.AxesManager.draw (axes_manager.js:63)
    at ChartFacade.../../node_modules/@operational/visualizations/lib/Chart/facade.js.ChartFacade.draw (facade.js:187)
    at VisualizationWrapper.../../node_modules/@operational/visualizations/lib/utils/VisualizationWrapper.js.VisualizationWrapper.componentDidUpdate (VisualizationWrapper.js:46)
    at commitLifeCycles (react-dom.development.js:17143)
    at commitAllLifeCycles (react-dom.development.js:18530)
    at HTMLUnknownElement.callCallback (react-dom.development.js:149)
    at Object.invokeGuardedCallbackDev (react-dom.development.js:199)
    at invokeGuardedCallback (react-dom.development.js:256)
    at commitRoot (react-dom.development.js:18742)

But I suspect (but no proof) that this change can have some negative consequences.

The problem is that viz instance has internal state, which is preserved across React component renders, which causes bugs

Published to canary as @operational/visualizations@6.1.0-349d69e

@stereobooster stereobooster self-assigned this Mar 22, 2019
@stereobooster stereobooster marked this pull request as ready for review March 22, 2019 12:17
@micha-f
Copy link
Member

micha-f commented Mar 25, 2019

@stereobooster We need to investigate the real problem inside of the visualizations. Creating a new visualization every time is the nuclear option. We will loose all transition animations etc.

@TejasQ
Copy link

TejasQ commented Mar 27, 2019

Let's close this until we have a proper solution.

@TejasQ TejasQ closed this Mar 27, 2019
@TejasQ TejasQ deleted the EX-8-grid-examples branch March 27, 2019 13:05
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants