Skip to content

Graphs do not render in PopOS React App #353

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Frick-David opened this issue May 20, 2025 · 0 comments
Open

Graphs do not render in PopOS React App #353

Frick-David opened this issue May 20, 2025 · 0 comments

Comments

@Frick-David
Copy link

Frick-David commented May 20, 2025

I am making a React app using Plotly connected to a flask backend. However, my graphs only display as white squares that when hovered over display the plotly toolbar.

This is a picture of what it looks like: here

When I use the command npm start, I get this message which might have something to do with it:

WARNING in ./node_modules/plotly.js/dist/plotly.js
Module Warning (from ./node_modules/source-map-loader/dist/cjs.js):
Failed to parse source map from '/home/david/Programming/Python-Projects/Investment-Hunter-Web/frontend/node_modules/plotly.js/dist/maplibre-gl-unminified.js.map' file: Error: ENOENT: no such file or directory, open '/home/david/Programming/Python-Projects/Investment-Hunter-Web/frontend/node_modules/plotly.js/dist/maplibre-gl-unminified.js.map'

Can anyone help me figure out why my plotly graphs are not displaying at all?

My code seems relatively straightforward as I hard coded the numbers to begin with just to get something going:

import React from 'react';
import Plot from 'react-plotly.js'

function Portfolio() {
    const growthPortfolio = [{
            values: [19, 26, 55],
            labels: ['Residential', 'Non-Residential', 'Utility'],
            type: 'pie',
            hole: 0.4,
    }]

    const valuePortfolio = [{
            values: [30, 40, 30],
            labels: ['Residential', 'Non-Residential', 'Utility'],
            type: 'pie',
            hole: 0.4,
    }]


    const totalPortfolio = [{
            values: [45, 35, 20],
            labels: ['Residential', 'Non-Residential', 'Utility'],
            type: 'pie',
            hole: 0.4,
    }]


    return (
        <div>
            <Plot data={growthPortfolio} />
            <Plot data={valuePortfolio} />
            <Plot data={totalPortfolio}/>
        </div>
    );
}

export default Portfolio;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant