This guide will help you migrate from WebDataRocks to Flexmonster in your project.
The migration process is simple: Flexmonster is embedded in a JavaScript application similarly to WebDataRocks, so the code you’ve created around the WebDataRocks component will require only minor changes.
If you are using a front-end framework, see how to migrate from WebDataRocks in a framework of your choice:
All possible ways to include Flexmonster in your project are described here: Get Flexmonster.
Import flexmonster.js
depending on how you have downloaded Flexmonster:
import Flexmonster from "flexmonster";
flexmonster.js
in HTML using the <script>
tag:<script src="node_modules/flexmonster/flexmonster.js"></script>
The flexmonster.js
file was imported in step 1.
<script src="flexmonster/flexmonster.js"></script>
Replace the new WebDataRocks() API call with the new Flexmonster() API call depending on how you have downloaded Flexmonster:
WebDataRocks:
const pivot = new WebDataRocks({
container: "pivotContainer",
toolbar: true,
report: {
// Your report
}
});
Flexmonster:
const pivot = new Flexmonster({ container: "pivotContainer", componentFolder: "node_modules/flexmonster/", toolbar: true, report: { // Your report } });
Notice the componentFolder
parameter in new Flexmonster()
— it should point to the folder with Flexmonster files. Since Flexmonster is installed as an npm package, the componentFolder
should be defined as node_modules/flexmonster/
.
WebDataRocks:
const pivot = new WebDataRocks({
container: "pivotContainer",
toolbar: true,
report: {
// Your report
}
});
Flexmonster:
const pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "https://cdn.flexmonster.com/",
toolbar: true,
report: {
// Your report
}
});
Notice the componentFolder
parameter in new Flexmonster()
— it should point to the folder with Flexmonster files. Since Flexmonster is included from our CDN, the componentFolder
should be defined as https://cdn.flexmonster.com/
(or https://cdn.flexmonster.com/<version>/
if you are using a specific Flexmonster version).
WebDataRocks:
const pivot = new WebDataRocks({
container: "pivotContainer",
toolbar: true,
report: {
// Your report
}
});
Flexmonster:
const pivot = new Flexmonster({
container: "pivotContainer",
componentFolder: "flexmonster/",
toolbar: true,
report: {
// Your report
}
});
Notice the componentFolder
parameter in new Flexmonster()
— it should point to the folder with Flexmonster files. If this folder is in the root of your project, the componentFolder
should be set to "flexmonster/"
. Otherwise, adjust the componentFolder
according to the flexmonster/
folder's location in your project.
Note To use a trial version of Flexmonster from the ZIP package, you need to set a trial key. It can be found in the flexmonster/TrialKey.txt
file. Copy the contents of the file and set the trial key using the licenseKey
initialization parameter:
const pivot = new Flexmonster({ container: "pivotContainer", // ... licenseKey: "XXXX-XXXX-XXXX-XXXX-XXXX" });
new Flexmonster()
has more initialization parameters than new WebDataRocks()
. See the full list of available parameters in the API reference: Flexmonster().
Flexmonster supports all methods and events available in WebDataRocks and provides additional ones. See the full list of Flexmonster methods and events.
To start using Flexmonster API, you need to:
pivot
, like in step 3), and now you will reuse that variable to reference Flexmonster. Otherwise, if you were referencing WebDataRocks through webdatarocks
, replace webdatarocks
with flexmonster
:webdatarocks.setReport(report);
flexmonster.setReport(report);
If your WebDataRocks component was translated into a different language, replace the WebDataRocks localization file with the corresponding Flexmonster file:
report: { // Other report configurations localization: "https://cdn.webdatarocks.com/loc/es.json" }
report: { // Other report configurations localization: "https://cdn.flexmonster.com/loc/es.json" }
Learn more about localizing Flexmonster.
To use a WebDataRocks report in Flexmonster, you need to make one minor change. The rest of the report will be converted automatically upon loading it in Flexmonster.
To update your report, change "uniqueName": "Measures"
to "uniqueName": "[Measures]"
in the slice:
"slice": { "rows": [ { // ... }, { "uniqueName": "Measures" } ], // Other properties }
"slice": { "rows": [ { // ... }, { "uniqueName": "[Measures]" } ], // Other properties }
Remove all WebDataRocks files used in your project:
webdatarocks.js
webdatarocks.toolbar.js
or webdatarocks.toolbar.min.js
webdatarocks.css
or webdatarocks.min.css
If WebDataRocks was installed from npm, run the following command to uninstall WebDataRocks:
npm uninstall @webdatarocks/webdatarocks
Open the page with the pivot table in the browser, then click on the grid and press Ctrl + Alt + i
(Option + Control + i
on macOS). You should see Flexmonster's licensing pop-up window; this would mean that WebDataRocks is successfully replaced by Flexmonster.
The migration is complete.
If you run into any issues during the migration, visit our troubleshooting page.
With Flexmonster, you can connect to JSON/CSV files, SQL and MongoDB databases, Elasticsearch, and Microsoft Analysis Services. See the full list of supported data sources.
Flexmonster also offers features that are not available in WebDataRocks: