DevExtreme DataSource
To get the DataSource instance, call the Sankey's getDataSource() method:
App.js
- import { useRef } from 'react';
- import Sankey from 'devextreme-react/sankey';
- export default function App() {
- const sankey = useRef(null);
- const getDataSource = () => {
- return sankey.current.instance().getDataSource();
- }
- return (
- <Sankey ref={sankey}>
- {/* ... */}
- </Sankey>
- );
- }
Then, access the underlying store with the store() method, and call the store's push(changes) method to modify data. The Sankey will be updated automatically.
JavaScript
- getDataSource().store().push([
- { type: "update", key: "Oranges", data: { count: 10 } },
- { type: "remove", key: "Apples" }
- ]);
See Also
Feel free to share topic-related thoughts here.
If you have technical questions, please create a support ticket in the DevExpress Support Center.
Thank you for the feedback!
If you have technical questions, please create a support ticket in the DevExpress Support Center.