Skip to content

Conversation

bpostlethwaite
Copy link
Member

This adds an onPurge callback to the component. Currently this component calls plotly.purge(gd) when unmounting which strips the graphDiv of data, layout, _fullData and _fullLayout. This hook allows applications to take corrective action like transferring these objects to a new object.

import React, {Component} from 'react';
import PropTypes from 'prop-types';
import isNumeric from 'fast-isnumeric';
import objectAssign from 'object-assign';
// import throttle from "throttle-debounce/throttle";

Copy link
Contributor

Choose a reason for hiding this comment

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

can we delete this commented out import

Copy link
Member Author

Choose a reason for hiding this comment

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

agreed though I'll let the future maintainer do it. Maybe they'll want to create a throttling issue or something.

@VeraZab
Copy link
Contributor

VeraZab commented Dec 30, 2017

yup, looks good 💃

@bpostlethwaite bpostlethwaite merged commit 94faf87 into master Dec 30, 2017
@bpostlethwaite bpostlethwaite deleted the addOnUnmountHook branch December 30, 2017 18:56
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.

2 participants