Editing NVD3 Stress Test (SVG) This edit will create a new revision. Your details (optional) Name Email (won’t be displayed; might be used for Gravatar) URL Test case details Title * Published (uncheck if you want to fiddle around before making the page public) Description (in case you feel further explanation is needed)(Markdown syntax is allowed) NVD3 v0.0.1 (D3.js) (https://raw.github.com/novus/nvd3/master/nv.d3.min.js) Are you a spammer? (just answer the question) Preparation code Preparation code HTML (this will be inserted in the <body> of a valid HTML5 document in standards mode) (useful when testing DOM operations or including libraries) <style> /******************** * TOOLTIP CSS */ .nvtooltip { position: absolute; background-color: rgba(255,255,255,1); padding: 10px; border: 1px solid #ddd; z-index: 10000; font-family: Arial; font-size: 13px; transition: opacity 500ms linear; -moz-transition: opacity 500ms linear; -webkit-transition: opacity 500ms linear; transition-delay: 500ms; -moz-transition-delay: 500ms; -webkit-transition-delay: 500ms; -moz-box-shadow: 4px 4px 8px rgba(0,0,0,.5); -webkit-box-shadow: 4px 4px 8px rgba(0,0,0,.5); box-shadow: 4px 4px 8px rgba(0,0,0,.5); -moz-border-radius: 10px; border-radius: 10px; pointer-events: none; -webkit-touch-callout: none; -webkit-user-select: none; -khtml-user-select: none; -moz-user-select: none; -ms-user-select: none; user-select: none; } .nvtooltip h3 { margin: 0; padding: 0; text-align: center; } .nvtooltip p { margin: 0; padding: 0; text-align: center; } .nvtooltip span { display: inline-block; margin: 2px 0; } /********** * Axes */ .nvd3 .axis path { fill: none; stroke: #000; stroke-opacity: .75; shape-rendering: crispEdges; } .nvd3 .axis path.domain { stroke-opacity: .75; } .nvd3 .axis line { fill: none; stroke: #000; stroke-opacity: .25; shape-rendering: crispEdges; } .nvd3 .axis line.zero { stroke-opacity: .75; } .nvd3 .axis .axisMaxMin text { font-weight: bold; } /********** * Lines */ .nvd3 .groups path.line { fill: none; stroke-width: 2.5px; stroke-linecap: round; shape-rendering: geometricPrecision; } .nvd3 .line.hover path { stroke-width: 6px; } .nvd3.line .nvd3.scatter .groups .point { fill-opacity: 0; stroke-opacity: 0; } .nvd3 .groups .point { transition: stroke-width 250ms linear, stroke-opacity 250ms linear; -moz-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; -webkit-transition: stroke-width 250ms linear, stroke-opacity 250ms linear; } .nvd3.scatter .groups .point.hover, .nvd3 .groups .point.hover { stroke-width: 20px; fill-opacity: .5 !important; stroke-opacity: .5 !important; } .nvd3 .point-paths path { stroke: #aaa; stroke-opacity: 0; fill: #eee; fill-opacity: 0; } .nvd3 .indexLine { cursor: ew-resize; } </style> <style> #svgtest { width: 500px; height: 300px; background-color: #EEE; } </style> <svg id="svgtest"></svg> <script src="https://raw.github.com/mbostock/d3/master/d3.v2.min.js"></script> <script src="https://raw.github.com/novus/nvd3/master/nv.d3.min.js"></script> <script> /* NVD3 */ var sin = [], cos = []; for (var i = 0; i < 100; i++) { sin.push({x: i, y: Math.sin(i/10)}); cos.push({x: i, y: .5 * Math.cos(i/10)}); } var nvd3_data = [{ values: sin, key: 'Sine', color: '#FF0000' }, { values: cos, key: 'Cosine', color: '#0000FF' }]; </script> Include JavaScript libraries as follows: <script src="//cdn.ext/library.js"></script> Define setup for all tests (variables, functions, arrays or other objects that will be used in the tests) (runs before each clocked test loop, outside of the timed code region) (e.g. define local test variables, reset global variables, clear canvas, etc.) (see FAQ) Define teardown for all tests (runs after each clocked test loop, outside of the timed code region) (see FAQ) Code snippets to compare Test 1 Title Async (check if this is an asynchronous test) Code nv.addGraph(function() { d3.select('#svgtest') .datum(nvd3_data) .call(nv.models.lineChart()); });