plotly / plotly/react-plotly.js

Getting Aw Snap Error for following code snippet

Open
#284 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
1.1k
Forks
138
Avg merge
3d 2h
Merged PRs (30d)
4

Description

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

export default function Histogram() {

  const data = [{
		"type": "histogram",
		"x": [0, 21000000, 0, 200, 0, 0, 0, 600000],
    "xbins": {
			"size": 1
		}
	}]

  const style = {
		"width": "600px",
		"height": "330px"
	}

  const layout = {
		"margin": {
			"t": 30
		},
		"xaxis": {
			"showline": true,
			"mirror": true,
			"linewidth": 2,
			"tickangle": 45,
			"automargin": true,
			"title": {
				"standoff": 20,
				"text": "feature_na e",
			}
		},
		"yaxis": {
			"showline": true,
			"mirror": true,
			"linewidth": 2,
			"tickangle": 0,
			"automargin": true,
			"title": {
				"standoff": 20,
				"text": "Frequency",
			}
		}
	}

  const renderPlot = () => {
    try {
      return (
        <Plot
          data={data}
          style={style}
          layout={layout}
          onError={(error) => console.log('Error message: ', error)}
        />
      )
    } catch (ex) {
      console.log(ex)
      return (<p>No Plot</p>)
    }
  }

  return (
    <div>
      {renderPlot()}
    </div>
  );
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the supplied React histogram snippet and confirm the “Aw Snap” failure in the project’s supported environment. The payload names no source file or test, so first locate the rendering entry point and existing histogram or error-handling tests; done means identifying the trigger and adding a regression check that no longer crashes.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, react
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.