ni-webcharts
Advanced tools
Comparing version 0.3.1 to 0.3.2
!function(){"use strict";NationalInstruments.HtmlVI.DataPipeline={},NationalInstruments.HtmlVI.DataPipeline.decimateAW=function(t,n,a,e){var i=(n-t.start)/t.step,o=(a-t.start)/t.step;return NationalInstruments.HtmlVI.DataPipeline.decimate1D(t,i,o,e)},NationalInstruments.HtmlVI.DataPipeline.decimate1D=function(t,n,a,e){var i,o=0,l=0,r=0,s=e/(a-n),m=t.datapoints.points,u=[],f=!0,c=-(1/0),h=-1,p=1/0,I=-1,M=Math.min(Math.max(0,Math.floor(n)),m.length/2),D=a>0?Math.min(m.length/2,Math.floor(a+2)):0,d=function(){I===h?(u[l]=I,u[l+1]=p,l+=2):(I<h?(u[l]=I,u[l+1]=p,u[l+2]=h,u[l+3]=c):(u[l]=h,u[l+1]=c,u[l+2]=I,u[l+3]=p),l+=4)},H=function(){c=-(1/0),h=-1,p=1/0,I=-1};for(r=D-M,e>r&&(s=1),i=2*M;i<2*D;i+=2)f&&(H(),f=!1),m[i+1]<p&&(I=m[i],p=m[i+1]),m[i+1]>c&&(h=m[i],c=m[i+1]),Math.floor(o)!==Math.floor(o+s)&&(d(),f=!0),o+=s;return f||d(),u}}(); | ||
!function(){"use strict";NationalInstruments.HtmlVI.DataPipeline.GraphDataPipeline=function(){};var r=Object.freeze({niAnalogWaveform:"niAnalogWaveform",niAnalogWaveformArray:"niAnalogWaveformArray",XYClusterOfArrays:"XYClusterOfArrays",XYArrayOfClusters:"XYArrayOfClusters",XYArrayOfClusterOfArrays:"XYArrayOfClusterOfArrays",XYArrayOfArrayOfClusters:"XYArrayOfArrayOfClusters",oneDimensionNumericArray:"1DNumericArray",twoDimensionsNumericArray:"2DNumericArray",oneDimensionComplexArray:"1DComplexArray",twoDimensionsComplexArray:"2DComplexArray",empty:"empty",unknown:"unknown"}),e=NationalInstruments.HtmlVI.DataPipeline.GraphDataPipeline,n=window.NIComplex||NationalInstruments.HtmlVI.NIComplex,t=window.NIAnalogWaveform||NationalInstruments.HtmlVI.NIAnalogWaveform,a=e.prototype;a.toFlot=function(r,e,n){return N(r,e,n)};var o=function(r){return!Array.isArray(r)&&"object"==typeof r&&Array.isArray(r.Y)},s=function(r){return Array.isArray(r)&&o(r[0])},i=function(r){return!Array.isArray(r)&&"object"==typeof r&&2===Object.keys(r).length&&Object.keys(r).every(function(e){return Array.isArray(r[e])})},u=function(r){return Array.isArray(r)&&!Array.isArray(r[0])&&"object"==typeof r[0]&&2===Object.keys(r[0]).length&&"number"==typeof r[0][Object.keys(r[0])[0]]},y=function(r){return Array.isArray(r)&&i(r[0])},A=function(r){return Array.isArray(r)&&u(r[0])},l=function(r){return Array.isArray(r)&&("string"==typeof r[0]||r[0]instanceof n)},f=function(r){return Array.isArray(r)&&Array.isArray(r[0])&&("string"==typeof r[0][0]||r[0][0]instanceof n)},m=function(e){return o(e)?r.niAnalogWaveform:s(e)?r.niAnalogWaveformArray:i(e)?r.XYClusterOfArrays:u(e)?r.XYArrayOfClusters:Array.isArray(e)?0===e.length?r.empty:"number"==typeof e[0]?r.oneDimensionNumericArray:y(e)?r.XYArrayOfClusterOfArrays:A(e)?r.XYArrayOfArrayOfClusters:l(e)?r.oneDimensionComplexArray:f(e)?r.twoDimensionsComplexArray:Array.isArray(e[0])?r.twoDimensionsNumericArray:r.unknown:r.unknown};a.inferDataType=m;var c=function(r){return{flatdata:!0,data:r.Y,start:r.t0.toAbsoluteTime(),step:r.dt,decimate:NationalInstruments.HtmlVI.DataPipeline.decimateAW}},p=function(r){for(var e=[],n=Object.keys(r),t=Math.min(r[n[0]].length,r[n[1]].length),a=0;a<t;a++)e.push([r[n[0]][a],r[n[1]][a]]);return e},O=function(r){for(var e=[],n=Object.keys(r[0]||{}),t=0;t<r.length;t++)e.push([r[t][n[0]],r[t][n[1]]]);return e},h=function(r){return r.map(function(r){return p(r)})},g=function(r){return r.map(function(r){return O(r)})},N=function(e,a,o){var s,i,u,y,A=[];switch(m(a)){case r.oneDimensionNumericArray:return[{flatdata:!0,data:a,start:0,step:1,decimate:NationalInstruments.HtmlVI.DataPipeline.decimate1D}];case r.twoDimensionsNumericArray:for(s=[],y=0;y<a.length;y++)A=[],s.push({flatdata:!0,start:0,step:1,data:a[y],decimate:NationalInstruments.HtmlVI.DataPipeline.decimate1D});return s;case r.niAnalogWaveform:return i=a instanceof t?a:new t(a),"string"==typeof i.channelName&&i.channelName.length>0&&e.updatePlotName(0,i.channelName),[c(i)];case r.niAnalogWaveformArray:for(s=[],y=0;y<a.length;y++)i=a[y]instanceof t?a[y]:new t(a[y]),"string"==typeof i.channelName&&i.channelName.length>0&&e.updatePlotName(y,i.channelName),s.push(c(i));return s;case r.XYClusterOfArrays:return[p(a)];case r.XYArrayOfClusterOfArrays:return h(a);case r.XYArrayOfClusters:return[O(a)];case r.XYArrayOfArrayOfClusters:return g(a);case r.oneDimensionComplexArray:for(u=0;u<a.length;u++)A.push(n.prototype.parseFromString(a[u]));return[A];case r.twoDimensionsComplexArray:for(s=[],y=0;y<a.length;y++){for(A=[],u=0;u<a[y].length;u++)A.push(n.prototype.parseFromString(a[y][u]));s.push(A)}return s}return s||[A]}}(); | ||
!function(){"use strict";NationalInstruments.HtmlVI.DataPipeline.GraphDataPipeline=function(){};var r=Object.freeze({niAnalogWaveform:"niAnalogWaveform",niAnalogWaveformArray:"niAnalogWaveformArray",XYClusterOfArrays:"XYClusterOfArrays",XYArrayOfClusters:"XYArrayOfClusters",XYArrayOfClusterOfArrays:"XYArrayOfClusterOfArrays",XYArrayOfArrayOfClusters:"XYArrayOfArrayOfClusters",oneDimensionNumericArray:"1DNumericArray",twoDimensionsNumericArray:"2DNumericArray",oneDimensionComplexArray:"1DComplexArray",twoDimensionsComplexArray:"2DComplexArray",empty:"empty",unknown:"unknown"}),e=NationalInstruments.HtmlVI.DataPipeline.GraphDataPipeline,t=window.NIComplex||NationalInstruments.HtmlVI.NIComplex,n=window.NIAnalogWaveform||NationalInstruments.HtmlVI.NIAnalogWaveform,a=e.prototype;a.toFlot=function(r,e,t){return D(r,e,t)};var o=function(r){return!Array.isArray(r)&&"object"==typeof r&&Array.isArray(r.Y)},i=function(r){return Array.isArray(r)&&o(r[0])},s=function(r){return!Array.isArray(r)&&"object"==typeof r&&2===Object.keys(r).length&&Object.keys(r).every(function(e){return Array.isArray(r[e])})},y=function(r){return Array.isArray(r)&&!Array.isArray(r[0])&&"object"==typeof r[0]&&2===Object.keys(r[0]).length&&"number"==typeof r[0][Object.keys(r[0])[0]]},u=function(r){return Array.isArray(r)&&s(r[0])},A=function(r){return Array.isArray(r)&&y(r[0])},f=function(r){return Array.isArray(r)&&("string"==typeof r[0]||r[0]instanceof t)},l=function(r){return Array.isArray(r)&&Array.isArray(r[0])&&("string"==typeof r[0][0]||r[0][0]instanceof t)},c=function(r){if("function"==typeof ArrayBuffer.isView)return ArrayBuffer.isView(r);var e=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]","[object DataView]"],t=Object.prototype.toString.call(r);return e.indexOf(t)!==-1},m=function(e){return o(e)?r.niAnalogWaveform:i(e)?r.niAnalogWaveformArray:s(e)?r.XYClusterOfArrays:y(e)?r.XYArrayOfClusters:Array.isArray(e)||c(e)?0===e.length?r.empty:"number"==typeof e[0]?r.oneDimensionNumericArray:u(e)?r.XYArrayOfClusterOfArrays:A(e)?r.XYArrayOfArrayOfClusters:f(e)?r.oneDimensionComplexArray:l(e)?r.twoDimensionsComplexArray:Array.isArray(e[0])||c(e[0])?r.twoDimensionsNumericArray:r.unknown:r.unknown};a.inferDataType=m;var p=function(r){return{flatdata:!0,data:r.Y,start:r.t0.toAbsoluteTime(),step:r.dt,decimate:NationalInstruments.HtmlVI.DataPipeline.decimateAW}},O=function(r){for(var e=[],t=Object.keys(r),n=Math.min(r[t[0]].length,r[t[1]].length),a=0;a<n;a++)e.push([r[t[0]][a],r[t[1]][a]]);return e},g=function(r){for(var e=[],t=Object.keys(r[0]||{}),n=0;n<r.length;n++)e.push([r[n][t[0]],r[n][t[1]]]);return e},h=function(r){return r.map(function(r){return O(r)})},C=function(r){return r.map(function(r){return g(r)})},D=function(e,a,o){var i,s,y,u,A=[];switch(m(a)){case r.oneDimensionNumericArray:return[{flatdata:!0,data:a,start:0,step:1,decimate:NationalInstruments.HtmlVI.DataPipeline.decimate1D}];case r.twoDimensionsNumericArray:for(i=[],u=0;u<a.length;u++)A=[],i.push({flatdata:!0,start:0,step:1,data:a[u],decimate:NationalInstruments.HtmlVI.DataPipeline.decimate1D});return i;case r.niAnalogWaveform:return s=a instanceof n?a:new n(a),"string"==typeof s.channelName&&s.channelName.length>0&&e.updatePlotName(0,s.channelName),[p(s)];case r.niAnalogWaveformArray:for(i=[],u=0;u<a.length;u++)s=a[u]instanceof n?a[u]:new n(a[u]),"string"==typeof s.channelName&&s.channelName.length>0&&e.updatePlotName(u,s.channelName),i.push(p(s));return i;case r.XYClusterOfArrays:return[O(a)];case r.XYArrayOfClusterOfArrays:return h(a);case r.XYArrayOfClusters:return[g(a)];case r.XYArrayOfArrayOfClusters:return C(a);case r.oneDimensionComplexArray:for(y=0;y<a.length;y++)A.push(t.prototype.parseFromString(a[y]));return[A];case r.twoDimensionsComplexArray:for(i=[],u=0;u<a.length;u++){for(A=[],y=0;y<a[u].length;y++)A.push(t.prototype.parseFromString(a[u][y]));i.push(A)}return i}return i||[A]}}(); | ||
!function(){"use strict";var t=NationalInstruments.HtmlVI.NISupport;NationalInstruments.HtmlVI.DataPipeline.ChartDataPipeline=function(){};var a=NationalInstruments.HtmlVI.DataPipeline.GraphDataPipeline,e=NationalInstruments.HtmlVI.DataPipeline.ChartDataPipeline.prototype;e.loadValueIntoHistoryBuffer=function(e,r){switch(a.prototype.inferDataType(e)){case"1DNumericArray":r.appendArray(e);break;case"2DNumericArray":var n=e.length;r.setWidth(n);for(var i=0;i<e[0].length;i++){for(var o=[],l=0;l<n;l++)o[l]=e[l][i];r.push(o)}break;case"empty":break;default:t.error("Unsupported value",this.value)}},e.toFlot=function(t,a,e){for(var r=[],n=t.historyBuffer.width,i=0;i<n;i++)r[i]=[];return r}}(); | ||
@@ -4,0 +4,0 @@ NationalInstruments.HtmlVI.Elements.CartesianGraphBase=function(){"use strict"},function(e,t){"use strict";var a=NationalInstruments.Globals.jQuery,r=NationalInstruments.HtmlVI.NISupport,i=NationalInstruments.HtmlVI.DataPipeline.GraphDataPipeline;r.inheritFromParent(e,t);var n=e.prototype,o=!0,s=!1;n.getSettings=function(){var e={lines:{show:!0,lineWidth:1},series:{shadowSize:0,points:{lineWidth:2}},axisLabels:{show:!0},xaxes:[{}],yaxes:[{}],zoom:{interactive:!0,trigger:null},pan:{interactive:!0},selection:{mode:null},grid:{}};return e},n.configureGraph=function(){var e,t=this.getSettings();for(""!==this.plotAreaMargin&&(t.grid.margin=JSON.parse(this.plotAreaMargin)),t.xaxes=[],t.yaxes=[],t.cursors=[],e=0;e<this.axes.length;e++){var a=this.axes[e],r=a.getViewConfig();r&&(!r.position||"left"!==r.position&&"right"!==r.position||t.yaxes.push(r),!r.position||"top"!==r.position&&"bottom"!==r.position||t.xaxes.push(r))}for(e=0;e<this.cursors.length;e++){var i=this.cursors[e],n=i.getViewConfig();t.cursors.push(n)}return this.graphTools&&(t.zoom.interactive=this.graphTools.allowsScrollWheelZoom(),t.pan.interactive=this.graphTools.allowsPan(),t.selection.mode="zoom"===this.graphTools.mode?"smart":null),t},n.updateGraphConfig=function(){var e=this.graphdiv;if(void 0!==e){var t=this.createData(this.plots,this.convertToFlotFormat(this.parsedValue)),i=this.configureGraph();this.setHover(t,i),this.setGridStyle(this.gridEl,i);try{this.graph=a.plot(e,t,i);var n=this;this.graph.getCursors().forEach(function(e,t){e.cookie=n.cursors[t],n.cursors[t].setCursor(e)})}catch(e){r.log(e.message)}}},n.onCursorUpdates=function(e,t){t.forEach(function(e,a){e.target.cookie.updateCursorElement(t[a])})},n.throttlePlotUpdates=function(e){o=!e,o&&s&&(this.updateGraphConfig(),s=!1)},n.updateGraphConfigWhenPlotsUpdatesAreEnabled=function(){o?(this.updateGraphConfig(),s=!1):s=!0},n.convertToFlotFormat=function(e){return i.prototype.toFlot(this,e)},n.updatePlotName=function(e,t){t&&this.plots[e]&&(this.plots[e].label=t)},n.createData=function(e,t){var a=[];return t.forEach(function(t,r){var i=e[r];Array.isArray(t)&&(t={data:t}),i?(a[r]=i.getViewConfig(),a[r].data=i.show?t.data:[],a[r].flatdata=t.flatdata,a[r].start=t.start,a[r].step=t.step,a[r].decimate=t.decimate):a[r]=t}),a},n.setData=function(e){var t=this.graph;t.setData(this.createData(this.plots,this.convertToFlotFormat(e))),t.setupGrid(),t.draw()},n.updateData=function(){this.setData(this.parsedValue)},n.addAllProperties=function(e){t.prototype.addAllProperties.call(this,e),n.addProperty(e,{propertyName:"value",defaultValue:"[]",fireEvent:!0,addNonSignalingProperty:!0,isElementValueProperty:!0}),n.addProperty(e,{propertyName:"graphRef",defaultValue:""}),n.addProperty(e,{propertyName:"plotAreaMargin",defaultValue:""})},n.createdCallback=function(){t.prototype.createdCallback.call(this),this.plots=[],this.axes=[],this.cursors=[],this.plotLegend=null,this.cursorLegend=null,this.scaleLegend=null,this.graphTools=null,this.graphdiv=void 0,this.tooltip=null,this.parsedValue=null},n.findGraphItems_early=function(){var e,t=[],a=NationalInstruments.HtmlVI.Elements.CartesianPlot.prototype.elementInfo.tagName.toUpperCase(),r=NationalInstruments.HtmlVI.Elements.CartesianAxis.prototype.elementInfo.tagName.toUpperCase();for(e=0;e<this.children.length;e++)this.children[e].tagName===r?t.push(this.children[e]):this.children[e].tagName===a&&t.push(this.children[e]);return t},n.forceResize=function(e){t.prototype.forceResize.call(this,e);var a=this.graph;void 0!==a&&(a.clearTextCache(),a.resize(),a.setupGrid(),a.draw())},n.createGraph=function(){var e=this,t=document.createElement("div");t.style.width="100%",t.style.height="100%",t.className="webchart-drawing-layer",this.appendChild(t);var i=document.createElement("div");i.id="tooltip"+r.uniqueId(),i.className="ni-graph-tooltip",this.appendChild(i),this.tooltip=i;var n=document.createElement("ni-grid-div");n.style.visibility="hidden",this.appendChild(n),this.gridEl=n,this.graphdiv=t;var o=this.createData(this.plots,this.convertToFlotFormat(this.parsedValue)),s=this.configureGraph();this.setHover(o,s),this.setGridStyle(this.gridEl,s);try{this.graph=a.plot(t,o,s)}catch(e){r.log("Failed to create a flot chart. Make sure that the placeholder element has a non-zero size !")}a(t).bind("plothover",function(t,r,n){if(n&&e.plots[n.seriesIndex]){var o=n.datapoint[0],s=n.datapoint[1],l=e.plots[n.seriesIndex].hoverFormat||"{0}, {1}",d=e.format(l,o,s);a(i).html(d).css({top:n.pageY-e.offsetTop+5,left:n.pageX-e.offsetLeft+5}).fadeIn(100)}else a(i).hide()});try{this.graph.getPlaceholder().bind("cursorupdates",this.onCursorUpdates),this.graph.getCursors().forEach(function(t,a){t.cookie=e.cursors[a],e.cursors[a].setCursor(t)})}catch(e){}},n.attachedCallback=function(){var e,a=t.prototype.attachedCallback.call(this);return a===!0&&(e=this.findGraphItems_early(),this.addGraphItemListeners(e),this.parsedValue=JSON.parse(this.value),this.createGraph(),this.attachLegends()),a},n.addGraphItemListeners=function(e){var t=this;t.addEventListener("ni-cartesian-plot-attached",function(a){var r;if(a.target===t){for(t.plots.push(a.detail.element),r=0;r<e.length;r++)if(e[r]===a.detail.element){e.splice(r,1);break}t.updateGraphConfigWhenPlotsUpdatesAreEnabled(),t.notifyPlotLegend("ni-cartesian-plot-attached",a.detail.element)}}),t.addEventListener("ni-cartesian-plot-detached",function(e){var a;if(t.notifyPlotLegend("ni-cartesian-plot-detached",e.detail.element),e.target===t){for(a=0;a<t.plots.length;a++)if(t.plots[a]===e.detail.element){t.plots.splice(a,1);break}t.updateGraphConfigWhenPlotsUpdatesAreEnabled()}}),t.addEventListener("ni-cartesian-axis-attached",function(a){var r;if(a.target===t){for(t.axes.push(a.detail.element),r=0;r<e.length;r++)if(e[r]===a.detail.element){e.splice(r,1);break}t.updateGraphConfig(),t.notifyScaleLegend("ni-cartesian-axis-attached",a.detail.element)}}),t.addEventListener("ni-cartesian-axis-detached",function(e){var a;if(e.target===t){for(a=0;a<t.axes.length;a++)if(t.axes[a]===e.detail.element){t.axes.splice(a,1);break}t.updateGraphConfig(),t.notifyScaleLegend("ni-cartesian-axis-detached",e.detail.element)}}),t.addEventListener("ni-cursor-attached",function(a){var r;if(a.target===t){for(t.cursors.push(a.detail.element),r=0;r<e.length;r++)if(e[r]===a.detail.element){e.splice(r,1);break}t.updateGraphConfig(),t.notifyCursorLegend("ni-cursor-attached",a.detail.element)}}),t.addEventListener("ni-cursor-detached",function(e){var a;if(e.target===t){for(a=0;a<t.cursors.length;a++)if(t.cursors[a]===e.detail.element){t.cursors.splice(a,1);break}t.updateGraphConfig(),t.notifyCursorLegend("ni-cursor-detached",e.detail.element)}}),t.addEventListener("ni-axis-changed",function(e){t.updateGraphConfig(),t.notifyScaleLegend("ni-axis-changed",e.detail.element)}),t.addEventListener("ni-cursor-changed",function(e){t.updateGraphConfig(),t.notifyCursorLegend("ni-cursor-changed",e.detail.element)}),t.addEventListener("ni-cartesian-plot-changed",function(e){t.updateGraphConfigWhenPlotsUpdatesAreEnabled(),t.notifyPlotLegend("ni-cartesian-plot-changed",e.detail.element)}),t.addEventListener("ni-cartesian-plot-renderer-changed",function(e){t.updateGraphConfigWhenPlotsUpdatesAreEnabled(),t.notifyPlotLegend("ni-cartesian-plot-renderer-changed",e.detail.originalSource)}),t.addEventListener("ni-cartesian-plot-renderer-attached",function(e){t.updateGraphConfigWhenPlotsUpdatesAreEnabled(),t.notifyPlotLegend("ni-cartesian-plot-renderer-attached",e.detail.originalSource)}),t.addEventListener("ni-cartesian-plot-renderer-detached",function(e){t.updateGraphConfigWhenPlotsUpdatesAreEnabled(),t.notifyPlotLegend("ni-cartesian-plot-renderer-detached",e.detail.originalSource)}),t.addEventListener("ni-graph-tools-changed",function(){t.updateGraphConfig()})},n.registerPlotLegend=function(e){this.plotLegend=e},n.notifyPlotLegend=function(e,t){var a;null!==this.plotLegend&&(a={bubbles:!1,cancelable:!0,detail:{element:this,originalSource:t}},this.plotLegend.dispatchEvent(new CustomEvent(e,a)))},n.registerCursorLegend=function(e){var t;if(this.cursorLegend=e,this.cursors.length>0)for(t=0;t<this.cursors.length;t++)this.notifyCursorLegend("ni-cursor-attached",this.cursors[t])},n.notifyCursorLegend=function(e,t){var a;null!==this.cursorLegend&&(a={bubbles:!1,cancelable:!0,detail:{element:this,originalSource:t}},this.cursorLegend.dispatchEvent(new CustomEvent(e,a)))},n.registerScaleLegend=function(e){var t;if(this.scaleLegend=e,this.axes.length>0)for(t=0;t<this.axes.length;t++)this.notifyScaleLegend("ni-cartesian-axis-attached",this.axes[t])},n.notifyScaleLegend=function(e,t){var a;null!==this.scaleLegend&&(a={bubbles:!1,cancelable:!0,detail:{element:this,originalSource:t}},this.scaleLegend.dispatchEvent(new CustomEvent(e,a)))},n.registerGraphTools=function(e){var t=this;this.graphTools=e,this.updateGraphConfig(),a(this.graphdiv).on("plotselected",function(e,a){t.notifyGraphTools("ni-cartesian-graph-box-selected",{ranges:a})}),a(this.graphdiv).on("plotpan",function(e,a){t.notifyGraphTools("ni-cartesian-graph-interaction",{ranges:a})}),a(this.graphdiv).on("plotzoom",function(e,a){t.notifyGraphTools("ni-cartesian-graph-interaction",{ranges:a})}),a(this.graphdiv).on("re-center",function(e){t.notifyGraphTools("ni-cartesian-graph-reCenter",e)})},n.notifyGraphTools=function(e,t){var a;null!==this.graphTools&&(a={bubbles:!1,cancelable:!0,detail:{element:this,originalSource:t}},this.graphTools.dispatchEvent(new CustomEvent(e,a)))},n.attachLegends=function(){for(var e=this,t=["ni-cursor-legend".toUpperCase(),"ni-plot-legend".toUpperCase(),"ni-cursor-legend".toUpperCase(),"ni-graph-tools".toUpperCase()],a=this.parentElement.children,r=[],i=0;i<a.length;i++){var n=a[i];t.indexOf(n.tagName)!==-1&&n.graphName===this.niControlId&&r.push(n)}r.forEach(function(t){t.attachToGraph(e)})},n.propertyUpdated=function(e){switch(t.prototype.propertyUpdated.call(this,e),e){case"value":this.parsedValue=JSON.parse(this.value),this.updateData();break;case"plotAreaMargin":this.updateGraphConfig()}},n.format=function(){var e=arguments,t=e[0];return t.replace(/{(\d+)}/g,function(t,a){var r=parseInt(a)+1,i=e[r];if("undefined"!=typeof i){var n=i.toFixed(2).length,o=i.toExponential(2).length;return n<o?i.toFixed(2):i.toExponential(2)}return t})},n.setHover=function(e,t){var r,i=!1;for(r=0;r<e.length;r++)if(e[r].hoverable){i=!0;break}i===!0?(void 0===t.grid&&(t.grid={}),t.grid.hoverable=i):null!==this.tooltip&&a(this.tooltip).hide()},n.setGridStyle=function(e,t){var a=t.grid,r=window.getComputedStyle(e),i=r.borderStyle,n=r.borderBottomWidth.replace("px",""),o=r.borderTopWidth.replace("px",""),s=r.borderLeftWidth.replace("px",""),l=r.borderRightWidth.replace("px",""),d={top:Number(o),bottom:Number(n),left:Number(s),right:Number(l)},h=r.borderColor,p=r.backgroundColor;a.borderWidth="solid"===i?d:0,a.borderColor=h,a.color=r.color,a.backgroundColor=p}}(NationalInstruments.HtmlVI.Elements.CartesianGraphBase,NationalInstruments.HtmlVI.Elements.Visual); |
@@ -108,5 +108,7 @@ # Webcharts Reference | ||
Will be drawn as a single plot. It's an efficient and fast way to | ||
pass data to the graph | ||
pass data to the graph. | ||
A typed array view is also allowed. | ||
* **A 2D array of numerics** | ||
@@ -117,5 +119,7 @@ ```js | ||
Will be drawn as multiple plots. It's an efficient and fast way to | ||
pass data to the graph | ||
pass data to the graph. | ||
An array of typed array views is also allowed. | ||
* **An analogWaveform** | ||
@@ -122,0 +126,0 @@ ```js |
@@ -62,5 +62,7 @@ ## ni-cartesian-graph | ||
Will be drawn as a single plot. It's an efficient and fast way to | ||
pass data to the graph | ||
pass data to the graph. | ||
A typed array view is also allowed. | ||
* **A 2D array of numerics** | ||
@@ -71,5 +73,7 @@ ```js | ||
Will be drawn as multiple plots. It's an efficient and fast way to | ||
pass data to the graph | ||
pass data to the graph. | ||
An array of typed array views is also allowed. | ||
* **An analogWaveform** | ||
@@ -76,0 +80,0 @@ ```js |
{ | ||
"name": "ni-webcharts", | ||
"version": "0.3.1", | ||
"version": "0.3.2", | ||
"description": "webcharts graph, chart, intensity graphs, plots and axes", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,15 +59,3 @@ # Webcharts [![Build Status](https://travis-ci.com/ni-kismet/webcharts.svg?token=MpaGws1pj7G9qToNQ6dS&branch=master)](https://travis-ci.com/ni-kismet/webcharts) | ||
# Graph Data types formats | ||
You can pass to the digital graph one of the following data types to render | ||
* **A series of 1DNumeric Arrays** - pass an Array of Arrays of numbers, for example *value="[[1, 2, 3], [7, 8, 9]]"* | ||
* **A series of 2DNumeric Arrays** - pass an Array of Arrays of XY coordinates, encoded as an array of [x, y], for example *value="[[[1, 1], [2, 2], [3,4], [[7, 7], [8, 80], [9, 90]]"* | ||
* **Analog Waveform** - TO DO | ||
# Chart Data types formats | ||
# Intensity Graph Data types formats | ||
# Documentation | ||
@@ -74,0 +62,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
496662
2217
75