Skip to content

Commit

Permalink
Merge pull request nteract#4550 from justvaldes/change-plotly-dependency
Browse files Browse the repository at this point in the history
Depend on official plotly bundle
  • Loading branch information
captainsafia committed Sep 4, 2019
2 parents e0f505a + fa1321c commit 8b57131
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/transform-plotly/__tests__/plotly.test.tsx
Expand Up @@ -4,7 +4,8 @@ import React from "react";

import PlotlyTransform from "../src";

const plotly = require("@nteract/plotly");
jest.mock("plotly.js-dist")
const plotly = require("plotly.js-dist");

function deepFreeze(obj) {
// Retrieve the property names defined on obj
Expand Down
2 changes: 1 addition & 1 deletion packages/transform-plotly/package.json
Expand Up @@ -12,7 +12,7 @@
"access": "public"
},
"dependencies": {
"@nteract/plotly": "^1.0.0",
"plotly.js-dist": "^1.48.3",
"lodash": "^4.17.4"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion packages/transform-plotly/src/index.tsx
Expand Up @@ -60,7 +60,7 @@ export class PlotlyTransform extends React.Component<Props> {
componentDidMount(): void {
// Handle case of either string to be `JSON.parse`d or pure object
const figure = this.getFigure();
this.Plotly = require("@nteract/plotly");
this.Plotly = require("plotly.js-dist");
this.Plotly.newPlot(this.plotDiv, figure.data, figure.layout);
}

Expand Down
1 change: 1 addition & 0 deletions scripts/test-shim.ts
Expand Up @@ -26,6 +26,7 @@ const createContextualFragment = html => {
Range.prototype.createContextualFragment = html =>
createContextualFragment(html);

global.window.URL.createObjectURL = function() {};
global.window.focus = () => {};

// HACK: Polyfill that allows codemirror to render in a JSDOM env.
Expand Down

0 comments on commit 8b57131

Please sign in to comment.