okld / streamlit-elements

Create a draggable and resizable dashboard in Streamlit, featuring Material UI widgets, Monaco editor (Visual Studio Code), Nivo charts, and more!
MIT License
734 stars 82 forks source link

Please update nivo and add the new charts! #36

Open TheUkrainian1991 opened 3 months ago

TheUkrainian1991 commented 3 months ago

I'm wanting to use nivo boxplot for my app but I get the error:

Element BoxPlot does not exist in module chartNivo

I did some digging in the repo and to frontend/components/modules/charts/Nivo.tsx added the line:

BoxPlot: dynamic(() => import("@nivo/boxplot").then(m => m.ResponsiveBoxPlot), { loading: ElementsLoading, ssr: false })

Same error. So I thought it must be the react dependencies. So I added the key '@nivo/boxplot' and value='^0.87.0' to both the frontend/package.json and frontend/package-locked.json under the appropriate dependency key.

Same error. So I then added the key "node_modules/@nivo/boxplot" and the value:

{
      "version": "0.82.1",
      "resolved": "registry.npmjs.org/@nivo/boxplot/-/boxplot-0.82.1.tgz",
      "integrity": "sha512-swJ2FtFeRPWJK9O6aZiqTDi2J6GrU2Z6kIHBBCXBlFmq6+vfd5AqOHytdXPTaN80JsKDBBdtY7tqRjpRPlDZwQ==",
      "dependencies": {
        "@nivo/annotations": "0.79.1",
        "@nivo/axes": "0.79.0",
        "@nivo/colors": "0.79.1",
        "@nivo/legends": "0.79.1",
        "@nivo/scales": "0.79.0",
        "@nivo/tooltip": "0.79.0",
        "@react-spring/web": "9.3.1",
        "d3-scale": "^3.2.3",
        "d3-shape": "^1.2.2",
        "lodash": "^4.17.21"
      },
      "peerDependencies": {
        "@nivo/core": "0.79.0",
        "react": ">= 16.14.0 < 18.0.0"
      }
    }

to the package-locked.json

Also the same error.

I know this is a hacky way but I have no knowledge of typescript and can't fork the repo myself. Is the install of the nivo charts happening when you install the actual repo? If so what is the best method to get the new charts in?