Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Commit

Permalink
Use plotly.js-dist to reduce artifact size (#340)
Browse files Browse the repository at this point in the history
  • Loading branch information
yizheliu-amazon authored Dec 4, 2020
1 parent 341327a commit 31b59c7
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 3,010 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"brace": "0.11.1",
"formik": "^2.2.5",
"lodash": "^4.17.20",
"plotly.js": "^1.55.2",
"plotly.js-dist": "^1.57.1",
"react-plotly.js": "^2.4.0",
"react-redux": "^7.2.0",
"reselect": "^4.0.0"
Expand Down
8 changes: 5 additions & 3 deletions public/pages/AnomalyCharts/containers/AnomalyHeatmapChart.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
import React, { useState } from 'react';

import moment from 'moment';
import { PlotData } from 'plotly.js';
import Plot from 'react-plotly.js';
import Plotly, { PlotData } from 'plotly.js-dist';
import plotComponentFactory from 'react-plotly.js/factory';
import { get, isEmpty } from 'lodash';
import {
EuiFlexItem,
Expand Down Expand Up @@ -89,6 +89,8 @@ export const AnomalyHeatmapChart = React.memo(
],
};

const PlotComponent = plotComponentFactory(Plotly);

const getViewEntityOptions = (inputHeatmapData: PlotData[]) => {
let individualEntities = [];
if (!isEmpty(inputHeatmapData)) {
Expand Down Expand Up @@ -439,7 +441,7 @@ export const AnomalyHeatmapChart = React.memo(
</EuiFlexItem>
</EuiFlexGroup>
) : (
<Plot
<PlotComponent
data={heatmapData}
style={{
position: 'relative',
Expand Down
Loading

0 comments on commit 31b59c7

Please sign in to comment.