From e4ee47b3df971746a7da801b58d205deead33e8d Mon Sep 17 00:00:00 2001 From: Megan Riel-Mehan Date: Thu, 23 Aug 2018 17:51:42 -0700 Subject: [PATCH] added histogram subplots to test --- types/plotly.js/test/index-tests.ts | 34 ++++++++++++++++++++++++++--- 1 file changed, 31 insertions(+), 3 deletions(-) diff --git a/types/plotly.js/test/index-tests.ts b/types/plotly.js/test/index-tests.ts index 71025975c1..c7339a0b4f 100644 --- a/types/plotly.js/test/index-tests.ts +++ b/types/plotly.js/test/index-tests.ts @@ -1,5 +1,5 @@ import * as Plotly from 'plotly.js'; -import { ScatterData, Layout, PlotlyHTMLElement, newPlot } from 'plotly.js'; +import { ScatterData, Layout, PlotData, PlotlyHTMLElement, newPlot } from 'plotly.js'; const graphDiv = '#test'; @@ -16,17 +16,45 @@ const graphDiv = '#test'; y: [16, 5, 11, 9], type: 'scatter' } as ScatterData; - const data = [trace1, trace2]; + const trace3 = { + yaxis: 'y2', + x: [1999, 2000, 2001, 2002], + name: 'x density', + marker: { color: 'rgb(102,0,0)' }, + type: 'histogram' + } as PlotData; + const trace4 = { + xaxis: 'x2', + y: [16, 5, 11, 9], + name: 'y density', + marker: { color: 'rgb(102,0,0)' }, + type: 'histogram' + } as PlotData; + const data = [trace1, trace2, trace3, trace4]; const layout = { title: 'Sales Growth', xaxis: { title: 'Year', + domain: [0, 0.85], showgrid: false, zeroline: false }, yaxis: { title: 'Percent', - showline: false + showline: false, + domain: [0, 0.85], + showgrid: false, + zeroline: false + }, + xaxis2: { + domain: [0.85, 1], + showgrid: false, + zeroline: false + }, + yaxis2: { + domain: [0.85, 1], + showgrid: false, + zeroline: false } }; Plotly.newPlot(graphDiv, data, layout);