SandDance
SandDance copied to clipboard
SandDance Explorer snapshot sharing
How to make my SandDance Explorer snapshots shareable?
In the SandDance Explorer example https://sanddance.js.org/app it is possible to share your snapshot with the 'share' button;
I can't find any information about this share/export option in the docs, the only 2 things I could find;
A function called SnapshotExport - https://github.com/microsoft/SandDance/blob/b0725a2eb975b248d6e6a61a2471d0fa97f41669/packages/sanddance-app/src/snapshots.tsx#L269
And a button that changes the url which makes it shareable - https://github.com/microsoft/SandDance/blob/b0725a2eb975b248d6e6a61a2471d0fa97f41669/packages/sanddance-app/src/snapshots.tsx#L301-L316
^These look like the function and button that I'm looking for but I don't know how to implement this in my code
Example of my explorerProps:
return {
//logoClickUrl: '/',
mounted: explorer => {
const service = this.getServices(process.env.webserver);
const url = myUrl
const dataFile = {
displayName: 'Mangrove',
dataUrl: url,
type: fileType
}
explorer.load(dataFile);
},
compactUI: { compactUI },
dataExportHandler: true
}
I was expecting that there would be an option like; 'snapshotSharing: boolean'.
DataExport:
In my code example above you can see that I've set the 'dataExportHandler' on true, but whenever I try to export my rows like this:
It displays the following error in my console;
Uncaught TypeError: this.props.dataExportHandler is not a function
Just like the snapshot sharing I cannot find anything regarding this function in the docs.
For snapshot sharing, see snapshotProps, an object with a getActions property, which returns an array of your own SnapShotActions. Here you can provide your own React elements for the snapshot actions.
The dataExportHandler
prop should be a function, please see this example
Closing this for now, if you have any feedback, please feel free to re-open.