All documentation
  • Introduction
  • Connecting to data source
  • Browser compatibility
  • Documentation for older versions
  • Migrating from WebDataRocks to Flexmonster

    This guide will help you migrate from WebDataRocks to Flexmonster in your React project.

    The migration process is simple: Flexmonster is embedded in a React application similarly to WebDataRocks, so the code you’ve created around the WebDataRocks component will require only minor changes.

    Step 1. Install Flexmonster CLI

    Flexmonster CLI is the most convenient way to work with Flexmonster Pivot. Install the CLI globally using npm:

    npm install -g flexmonster-cli

    As a result, a new flexmonster command will be available in the console. Learn more about Flexmonster CLI.

    Step 2. Get Flexmonster Pivot

    Get Flexmonster for React by running the following command inside your project:

    flexmonster add react-flexmonster

    This command downloads the react-flexmonster wrapper to node_modules/ and adds it as a dependency to package.json.

    Step 3. Replace WebDataRocks import

    In every component where WebDataRocks is used (e.g., src/App.jsx or src/App.tsx), import the Flexmonster React wrapper instead of the WebDataRocks React wrapper:

    WebDataRocks

    import * as WebDataRocksReact from "@webdatarocks/react-webdatarocks";

    Flexmonster

    import * as FlexmonsterReact from "react-flexmonster";

    Step 4. Replace the WebDataRocksReact.Pivot component

    In every component where WebDataRocks is used (e.g., src/App.jsx or src/App.tsx), replace the WebDataRocksReact.Pivot component with FlexmonsterReact.Pivot:

    WebDataRocks

    <WebDataRocksReact.Pivot
      report={report}
    />

    Flexmonster

    <FlexmonsterReact.Pivot
      report={report}
    />

    Note You need to change only the component’s name. Its props may stay the same.

    FlexmonsterReact.Pivot has more props than WebDataRocksReact.Pivot. Learn more about the FlexmonsterReact.Pivot component and its props.

    Step 5. Replace WebDataRocks styles

    Open the CSS file with WebDataRocks styles (e.g., src/index.css) and replace them with Flexmonster styles:

    WebDataRocks

    @import "@webdatarocks/webdatarocks/webdatarocks.css";

    Flexmonster

    @import "flexmonster/flexmonster.css";

    Note If you were using one of WebDataRocks’ predefined themes, replace it with a corresponding Flexmonster theme.

    Step 6. Replace WebDataRocks API with Flexmonster API

    WebDataRocks API is supported in Flexmonster, so you can continue using the methods and events you’ve used in your project. Follow the steps below to migrate to Flexmonster API.

    ES6

    Step 6.1. Update methods

    Flexmonster supports all WebDataRocks methods and provides additional ones. See the full list of Flexmonster methods.

    To start using Flexmonster methods, you need to:

    1. Change the WebDataRocks instance to the Flexmonster instance in method calls. For example:
      • WebDataRocks
        pivotRef.current.webdatarocks.setReport(report);
      • Flexmonster
        pivotRef.current.flexmonster.setReport(report);
    2. Update methods themselves if needed.
      Since all WebDataRocks methods are available in Flexmonster, there is no need to update method names.
      However, some Flexmonster methods have slightly different signatures. Check them out in the API Reference.

    Step 6.2. Update events

    Flexmonster supports all WebDataRocks events and provides additional ones. See the full list of Flexmonster events.

    Since all WebDataRocks events are available in Flexmonster, there is no need to update event names in your code. However, some Flexmonster events have slightly different signatures. Check them out in the API Reference.

    Note If you subscribe to events through the on() and off() methods, ensure you have changed the WebDataRocks instance to the Flexmonster instance when calling these methods.

    TypeScript

    Step 6.1. Replace the WebDataRocks namespace with the Flexmonster namespace

    The namespaces are needed for type definitions. Skip this step if you are not using WebDataRocks types (e.g., Slice or CellData).

    In every .tsx file with code for WebDataRocks (e.g., App.tsx), import the Flexmonster namespace instead of the WebDataRocks namespace:

    • WebDataRocks
      import "@webdatarocks/webdatarocks";
    • Flexmonster
      import "flexmonster";

    Step 6.2. Update references to the component instance

    A reference is needed to use Flexmonster methods and events. Update all the references by changing WebDataRocksReact.Pivot to FlexmonsterReact.Pivot:

    • WebDataRocks
      const ref: React.RefObject<WebDataRocksReact.Pivot> =
      useRef<WebDataRocksReact.Pivot>(null);
    • Flexmonster
      const ref: React.RefObject<FlexmonsterReact.Pivot> =
      useRef<FlexmonsterReact.Pivot>(null);

    Step 6.3. Update methods

    Flexmonster supports all WebDataRocks methods and provides additional ones. See the full list of Flexmonster methods.

    To start using Flexmonster methods, you need to:

    1. Change the WebDataRocks instance to the Flexmonster instance in method calls. For example:
      • WebDataRocks
        pivotRef.current?.webdatarocks.setReport(report);
      • Flexmonster
        pivotRef.current?.flexmonster.setReport(report);
    2. Update methods themselves if needed.
      Since all WebDataRocks methods are available in Flexmonster, there is no need to update method names.
      However, some Flexmonster methods have slightly different signatures. Check them out in the API Reference.

    Step 6.4. Update events

    Flexmonster supports all WebDataRocks events and provides additional ones. See the full list of Flexmonster events.

    Since all WebDataRocks events are available in Flexmonster, there is no need to update event names in your code. However, some Flexmonster events have slightly different signatures. Check them out in the API Reference.

    Note If you subscribe to events through the on() and off() methods, ensure you have changed the WebDataRocks instance to the Flexmonster instance when calling these methods.

    Step 6.5. Update objects

    Objects are passed as parameters to methods and event handlers. All WebDataRocks objects are available in Flexmonster.

    To replace WebDataRocks objects with Flexmonster objects, you need to:

    1. Change their namespace from WebDataRocks to Flexmonster. For example:
      • WebDataRocks
        function customizeCellFunction(cell: WebDataRocks.CellBuilder,
        data: WebDataRocks.CellData) {
          // Function body
        }
      • Flexmonster
        function customizeCellFunction(cell: Flexmonster.CellBuilder,
        data: Flexmonster.CellData) {
          // Function body
        }
    2. Update objects themselves if needed.
      Since all WebDataRocks objects are available in Flexmonster, there is no need to update object names.
      However, some Flexmonster objects have slightly different properties. Check them out in the API Reference.

    Step 7. Replace the localization file

    If your WebDataRocks component was translated into a different language, replace the WebDataRocks localization file with the corresponding Flexmonster file:

    WebDataRocks

    report: {
      // Other report configurations
      localization: "https://cdn.webdatarocks.com/loc/es.json"
    }

    Flexmonster

    report: {
      // Other report configurations
      localization: "https://cdn.flexmonster.com/loc/es.json"
    }

    Learn more about localizing Flexmonster.

    Step 8. Update your reports

    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:

    WebDataRocks

    "slice": {
      "rows": [
        {
          // ...
        },
        {
          "uniqueName": "Measures"
        }
      ],
      // Other properties
    }

    Flexmonster

    "slice": {
      "rows": [
        {
          // ...
        },
        {
          "uniqueName": "[Measures]"
        }
      ],
      // Other properties
    }

    Step 9. Uninstall WebDataRocks

    Uninstall WebDataRocks by running the following command inside your project:

    npm uninstall @webdatarocks/react-webdatarocks

    Step 10. Run the application

    Run your application from the console:

    npm start

    Open your application in the browser and go to the page with the pivot table. 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.

    Troubleshooting

    If you run into any issues during the migration, visit our troubleshooting page.

    What’s next?

    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: