diff --git a/src/traces/table/data_preparation_helper.js b/src/traces/table/data_preparation_helper.js index 9e91767231c..34a158a9584 100644 --- a/src/traces/table/data_preparation_helper.js +++ b/src/traces/table/data_preparation_helper.js @@ -14,19 +14,28 @@ var isNumeric = require('fast-isnumeric'); // pure functions, don't alter but passes on `gd` and parts of `trace` without deep copying module.exports = function calc(gd, trace) { - var cellsValues = trace.cells.values; + var cellsValues = squareStringMatrix(trace.cells.values); var slicer = function(a) { return a.slice(trace.header.values.length, a.length); }; - var headerValues = trace.header.values.map(function(c) { - return Array.isArray(c) ? c : [c]; - }).concat(slicer(cellsValues).map(function() {return [''];})); + var headerValuesIn = squareStringMatrix(trace.header.values); + if(headerValuesIn.length && !headerValuesIn[0].length) { + headerValuesIn[0] = ['']; + headerValuesIn = squareStringMatrix(headerValuesIn); + } + var headerValues = headerValuesIn + .concat(slicer(cellsValues).map(function() { + return emptyStrings((headerValuesIn[0] || ['']).length); + })); + var domain = trace.domain; var groupWidth = Math.floor(gd._fullLayout._size.w * (domain.x[1] - domain.x[0])); var groupHeight = Math.floor(gd._fullLayout._size.h * (domain.y[1] - domain.y[0])); - var headerRowHeights = trace.header.values.length ? headerValues[0].map(function() {return trace.header.height;}) : [c.emptyHeaderHeight]; - var rowHeights = cellsValues.length ? cellsValues[0].map(function() {return trace.cells.height;}) : []; - var headerHeight = headerRowHeights.reduce(function(a, b) {return a + b;}, 0); + var headerRowHeights = trace.header.values.length ? + headerValues[0].map(function() { return trace.header.height; }) : + [c.emptyHeaderHeight]; + var rowHeights = cellsValues.length ? cellsValues[0].map(function() { return trace.cells.height; }) : []; + var headerHeight = headerRowHeights.reduce(sum, 0); var scrollHeight = groupHeight - headerHeight; var minimumFillHeight = scrollHeight + c.uplift; var anchorToRowBlock = makeAnchorToRowBlock(rowHeights, minimumFillHeight); @@ -41,10 +50,12 @@ module.exports = function calc(gd, trace) { trace.columnwidth; return isNumeric(value) ? Number(value) : 1; }); - var totalColumnWidths = columnWidths.reduce(function(p, n) {return p + n;}, 0); + var totalColumnWidths = columnWidths.reduce(sum, 0); // fit columns in the available vertical space as there's no vertical scrolling now - columnWidths = columnWidths.map(function(d) {return d / totalColumnWidths * groupWidth;}); + columnWidths = columnWidths.map(function(d) { return d / totalColumnWidths * groupWidth; }); + + var maxLineWidth = Math.max(arrayMax(trace.header.line.width), arrayMax(trace.cells.line.width)); var calcdata = { key: trace.index, @@ -52,13 +63,14 @@ module.exports = function calc(gd, trace) { translateY: gd._fullLayout._size.h * (1 - domain.y[1]), size: gd._fullLayout._size, width: groupWidth, + maxLineWidth: maxLineWidth, height: groupHeight, columnOrder: columnOrder, // will be mutated on column move, todo use in callback groupHeight: groupHeight, rowBlocks: rowBlocks, headerRowBlocks: headerRowBlocks, scrollY: 0, // will be mutated on scroll - cells: trace.cells, + cells: extendFlat({}, trace.cells, {values: cellsValues}), headerCells: extendFlat({}, trace.header, {values: headerValues}), gdColumns: headerValues.map(function(d) {return d[0];}), gdColumnsOriginalOrder: headerValues.map(function(d) {return d[0];}), @@ -89,6 +101,47 @@ module.exports = function calc(gd, trace) { return calcdata; }; +function arrayMax(maybeArray) { + if(Array.isArray(maybeArray)) { + var max = 0; + for(var i = 0; i < maybeArray.length; i++) { + max = Math.max(max, arrayMax(maybeArray[i])); + } + return max; + } + return maybeArray; +} + +function sum(a, b) { return a + b; } + +// fill matrix in place to equal lengths +// and ensure it's uniformly 2D +function squareStringMatrix(matrixIn) { + var matrix = matrixIn.slice(); + var minLen = Infinity; + var maxLen = 0; + var i; + for(i = 0; i < matrix.length; i++) { + if(!Array.isArray(matrix[i])) matrix[i] = [matrix[i]]; + minLen = Math.min(minLen, matrix[i].length); + maxLen = Math.max(maxLen, matrix[i].length); + } + + if(minLen !== maxLen) { + for(i = 0; i < matrix.length; i++) { + var padLen = maxLen - matrix[i].length; + if(padLen) matrix[i] = matrix[i].concat(emptyStrings(padLen)); + } + } + return matrix; +} + +function emptyStrings(len) { + var padArray = new Array(len); + for(var j = 0; j < len; j++) padArray[j] = ''; + return padArray; +} + function xScale(d) { return d.calcdata.columns.reduce(function(prev, next) { return next.xIndex < d.xIndex ? prev + next.columnWidth : prev; diff --git a/src/traces/table/plot.js b/src/traces/table/plot.js index e55f43cf1a7..3d71289fa1b 100644 --- a/src/traces/table/plot.js +++ b/src/traces/table/plot.js @@ -221,12 +221,18 @@ module.exports = function plot(gd, wrappedTraceHolders) { .attr('fill', 'none'); columnBoundaryRect - .attr('width', function(d) {return d.columnWidth;}) - .attr('height', function(d) {return d.calcdata.height + c.uplift;}); + .attr('width', function(d) { return d.columnWidth + 2 * roundHalfWidth(d); }) + .attr('height', function(d) {return d.calcdata.height + 2 * roundHalfWidth(d) + c.uplift;}) + .attr('x', function(d) { return -roundHalfWidth(d); }) + .attr('y', function(d) { return -roundHalfWidth(d); }); updateBlockYPosition(null, cellsColumnBlock, tableControlView); }; +function roundHalfWidth(d) { + return Math.ceil(d.calcdata.maxLineWidth / 2); +} + function scrollAreaBottomClipKey(gd, d) { return 'clip' + gd._fullLayout._uid + '_scrollAreaBottomClip_' + d.key; } diff --git a/test/image/baselines/grid_subplot_types.png b/test/image/baselines/grid_subplot_types.png index 3627f6c26fd..0864d7dc0c9 100644 Binary files a/test/image/baselines/grid_subplot_types.png and b/test/image/baselines/grid_subplot_types.png differ diff --git a/test/image/baselines/table_latex_multitrace.png b/test/image/baselines/table_latex_multitrace.png deleted file mode 100644 index ae471dfaa1a..00000000000 Binary files a/test/image/baselines/table_latex_multitrace.png and /dev/null differ diff --git a/test/image/baselines/table_latex_multitrace_scatter.png b/test/image/baselines/table_latex_multitrace_scatter.png index 5a8a144d472..ff39013e729 100644 Binary files a/test/image/baselines/table_latex_multitrace_scatter.png and b/test/image/baselines/table_latex_multitrace_scatter.png differ diff --git a/test/image/baselines/table_plain_birds.png b/test/image/baselines/table_plain_birds.png index 434f8b99832..7e697a7e6b8 100644 Binary files a/test/image/baselines/table_plain_birds.png and b/test/image/baselines/table_plain_birds.png differ diff --git a/test/image/baselines/table_ragged.png b/test/image/baselines/table_ragged.png new file mode 100644 index 00000000000..bb1b7b4f5da Binary files /dev/null and b/test/image/baselines/table_ragged.png differ diff --git a/test/image/baselines/table_wrapped_birds.png b/test/image/baselines/table_wrapped_birds.png index 85be3465bbf..e62e2a0b792 100644 Binary files a/test/image/baselines/table_wrapped_birds.png and b/test/image/baselines/table_wrapped_birds.png differ diff --git a/test/image/mocks/table_latex_multitrace.json b/test/image/mocks/table_latex_multitrace.json deleted file mode 100644 index 4656524e2fe..00000000000 --- a/test/image/mocks/table_latex_multitrace.json +++ /dev/null @@ -1,137 +0,0 @@ -{ - "layout": { - "width": 1000, - "height": 600, - "title": "Half and Double Angles" - }, - - "data": [ - { - - "type": "table", - - "domain": { - "x": [0, 0.45], - "y": [0.55, 1] - }, - - "columnwidth": [30, 200, 200], - "columnorder": [0, 1, 2], - - "header": { - "values": ["#", "Half-angle form", "Equivalent"], - "align": ["right", "center", "center"], - "line": {"width": 0.0}, - "fill": {"color": ["dimgray", "grey"]}, - "font": {"family": "Arial", "size": 14, "color": "white"} - }, - - "cells": { - "values": [ - ["1.", "2."], - ["$$\\cos^2\\theta=\\displaystyle\\frac{1+\\cos\\theta}{2}$$", "$$\\sin^2\\theta=\\displaystyle\\frac{1-\\cos\\theta}{2}$$"], - ["$$\\cos\\theta=\\pm\\sqrt{\\displaystyle\\frac{1+\\cos\\theta}{2}}$$", "$$\\sin\\theta=\\pm\\sqrt{\\displaystyle\\frac{1-\\cos\\theta}{2}}$$"] - ], - "align": ["right", "center", "center"], - "font": {"family": "Arial", "size": 12, "color": ["black"]} - } - }, - { - - "type": "table", - - "domain": { - "x": [0.55, 1], - "y": [0.55, 1] - }, - - "columnwidth": [15, 20, 60, 60], - "columnorder": [0, 1, 2, 3], - - "header": { - "values": [["#"], ["$$\\theta$$"], ["Half-angle sine"], ["Half-angle cosine"]], - "align": "right", - "line": {"width": 0.0}, - "fill": {"color": ["dimgray", "grey"]}, - "font": {"family": "Arial", "size": 14, "color": "white"} - }, - - "cells": { - "values": [ - [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314], - [0,0.02,0.04,0.06,0.08,0.1,0.12,0.14,0.16,0.18,0.2,0.22,0.24,0.26,0.28,0.3,0.32,0.34,0.36,0.38,0.4,0.42,0.44,0.46,0.48,0.5,0.52,0.54,0.56,0.58,0.6,0.62,0.64,0.66,0.68,0.7,0.72,0.74,0.76,0.78,0.8,0.82,0.84,0.86,0.88,0.9,0.92,0.94,0.96,0.98,1,1.02,1.04,1.06,1.08,1.1,1.12,1.14,1.16,1.18,1.2,1.22,1.24,1.26,1.28,1.3,1.32,1.34,1.36,1.38,1.4,1.42,1.44,1.46,1.48,1.5,1.52,1.54,1.56,1.58,1.6,1.62,1.64,1.66,1.68,1.7,1.72,1.74,1.76,1.78,1.8,1.82,1.84,1.86,1.88,1.9,1.92,1.94,1.96,1.98,2,2.02,2.04,2.06,2.08,2.1,2.12,2.14,2.16,2.18,2.2,2.22,2.24,2.26,2.28,2.3,2.32,2.34,2.36,2.38,2.4,2.42,2.44,2.46,2.48,2.5,2.52,2.54,2.56,2.58,2.6,2.62,2.64,2.66,2.68,2.7,2.72,2.74,2.76,2.78,2.8,2.82,2.84,2.86,2.88,2.9,2.92,2.94,2.96,2.98,3,3.02,3.04,3.06,3.08,3.1,3.12,3.14,3.16,3.18,3.2,3.22,3.24,3.26,3.28,3.3,3.32,3.34,3.36,3.38,3.4,3.42,3.44,3.46,3.48,3.5,3.52,3.54,3.56,3.58,3.6,3.62,3.64,3.66,3.68,3.7,3.72,3.74,3.76,3.78,3.8,3.82,3.84,3.86,3.88,3.9,3.92,3.94,3.96,3.98,4,4.02,4.04,4.06,4.08,4.1,4.12,4.14,4.16,4.18,4.2,4.22,4.24,4.26,4.28,4.3,4.32,4.34,4.36,4.38,4.4,4.42,4.44,4.46,4.48,4.5,4.52,4.54,4.56,4.58,4.6,4.62,4.64,4.66,4.68,4.7,4.72,4.74,4.76,4.78,4.8,4.82,4.84,4.86,4.88,4.9,4.92,4.94,4.96,4.98,5,5.02,5.04,5.06,5.08,5.1,5.12,5.14,5.16,5.18,5.2,5.22,5.24,5.26,5.28,5.3,5.32,5.34,5.36,5.38,5.4,5.42,5.44,5.46,5.48,5.5,5.52,5.54,5.56,5.58,5.6,5.62,5.64,5.66,5.68,5.7,5.72,5.74,5.76,5.78,5.8,5.82,5.84,5.86,5.88,5.9,5.92,5.94,5.96,5.98,6,6.02,6.04,6.06,6.08,6.1,6.12,6.14,6.16,6.18,6.2,6.22,6.24,6.26,6.28], - [0,0.009999833334166664,0.01999866669333308,0.02999550020249566,0.03998933418663416,0.04997916927067833,0.059964006479444595,0.06994284733753277,0.0799146939691727,0.08987854919801104,0.09983341664682815,0.10977830083717481,0.11971220728891936,0.12963414261969486,0.1395431146442365,0.14943813247359922,0.15931820661424598,0.16918234906699603,0.17902957342582418,0.18885889497650057,0.19866933079506122,0.20845989984609956,0.21822962308086932,0.2279775235351884,0.23770262642713458,0.24740395925452294,0.2570805518921551,0.26673143668883115,0.27635564856411376,0.28595222510483553,0.29552020666133955,0.3050586364434435,0.31456656061611776,0.32404302839486837,0.3334870921408144,0.34289780745545134,0.35227423327508994,0.361615431964962,0.3709204694129827,0.3801884151231614,0.3894183423086505,0.3986093279844229,0.40776045305957015,0.41687080242921076,0.4259394650659996,0.43496553411123023,0.4439481069655198,0.4528862853790683,0.46177917554148284,0.470625888171158,0.479425538604203,0.48817724688290753,0.49688013784373675,0.5055333412048469,0.5141359916531132,0.5226872289306592,0.5311861979208834,0.5396320487339692,0.5480239367918736,0.5563610229127838,0.5646424733950354,0.5728674601004813,0.5810351605373051,0.5891447579422695,0.5971954413623921,0.6051864057360395,0.6131168519734338,0.6209859870365597,0.6287930240184686,0.6365371822219679,0.644217687237691,0.6518337710215366,0.6593846719714731,0.6668696350036979,0.674287911628145,0.6816387600233341,0.6889214451105513,0.6961352386273567,0.7032794192004101,0.7103532724176078,0.7173560908995228,0.7242871743701426,0.7311458297268958,0.7379313711099627,0.7446431199708593,0.7512804051402927,0.757842562895277,0.7643289370255051,0.7707388788989693,0.7770717475268238,0.7833269096274834,0.7895037396899505,0.795601620036366,0.8016199408837772,0.8075581004051142,0.8134155047893737,0.8191915683009983,0.8248857133384501,0.8304973704919705,0.8360259786005205,0.8414709848078965,0.8468318446180152,0.852108021949363,0.8572989891886034,0.8624042272433384,0.867423225594017,0.8723554823449863,0.8772005042746817,0.8819578068849475,0.8866269144494873,0.8912073600614354,0.8956986856800476,0.9001004421765051,0.9044121893788258,0.9086334961158832,0.912763940260521,0.9168031087717669,0.9207505977361357,0.9246060124080203,0.9283689672491666,0.9320390859672263,0.9356160015533859,0.9390993563190676,0.9424888019316975,0.945783999449539,0.9489846193555862,0.9520903415905158,0.9551008555846923,0.9580158602892249,0.9608350642060727,0.963558185417193,0.966184951612734,0.9687151001182652,0.9711483779210446,0.9734845416953194,0.9757233578266591,0.9778646024353163,0.9799080613986142,0.9818535303723597,0.9837008148112765,0.9854497299884601,0.9871001010138504,0.9886517628517197,0.9901045603371778,0.9914583481916864,0.9927129910375885,0.9938683634116449,0.9949243497775809,0.99588084453764,0.9967377520431434,0.9974949866040544,0.9981524724975481,0.998710143975583,0.999167945271476,0.9995258306054791,0.999783764189357,0.9999417202299663,0.9999996829318346,0.9999576464987401,0.9998156151342908,0.9995736030415051,0.9992316344213905,0.998789743470524,0.9982479743776325,0.9976063813191737,0.9968650284539189,0.9960239899165367,0.9950833498101802,0.994043202198076,0.9929036510941185,0.9916648104524686,0.990326804156158,0.9888897660047015,0.9873538397007164,0.9857191788355535,0.9839859468739369,0.9821543171376185,0.9802244727880455,0.9781966068080447,0.9760709219825242,0.9738476308781951,0.9715269558223153,0.9691091288804563,0.9665943918332975,0.9639829961524481,0.9612752029752999,0.9584712830789142,0.955571516852944,0.9525761942715953,0.9494856148646305,0.9463000876874145,0.9430199312900106,0.9396454736853249,0.9361770523163061,0.9326150140222005,0.9289597150038693,0.9252115207881683,0.9213708061913954,0.9174379552818098,0.9134133613412252,0.9092974268256817,0.905090563325201,0.9007931915226273,0.89640574115156,0.8919286509533796,0.8873623686333755,0.8827073508159741,0.8779640629990781,0.8731329795075164,0.8682145834456126,0.8632093666488737,0.8581178296348089,0.8529404815528762,0.8476778401335698,0.8423304316366457,0.8368987907984977,0.8313834607786831,0.8257849931056082,0.8201039476213741,0.814340892425796,0.8084964038195901,0.8025710662467472,0.7965654722360865,0.7904802223420048,0.7843159250844198,0.7780731968879212,0.7717526620201259,0.7653549525292536,0.758880708180922,0.7523305763941708,0.7457052121767203,0.7390052780594708,0.7322314440302514,0.7253843874668195,0.7184647930691261,0.7114733527908443,0.7044107657701763,0.6972777382599378,0.6900749835569364,0.6828032219306397,0.675463180551151,0.6680555934164909,0.6605812012792007,0.6530407515722648,0.6454349983343708,0.6377647021345036,0.6300306299958922,0.6222335553193046,0.6143742578057118,0.6064535233783147,0.5984721441039564,0.590430918113913,0.5823306495240819,0.5741721483545726,0.5659562304487028,0.557683717391417,0.5493554364271266,0.5409722203769886,0.5325349075556212,0.5240443416872761,0.5155013718214642,0.5069068522480534,0.49826164241183857,0.4895666068265995,0.48082261498864826,0.47203054128988264,0.4631912649303452,0.45430566983030646,0.44537464454187115,0.4363990821601263,0.4273798802338298,0.418317940675659,0.4092141696720173,0.4000694775924195,0.3908847788984522,0.38166099205233167,0.3723990394250557,0.3630998472041683,0.3537643453011431,0.34439346725839,0.3349881501559051,0.32554933451756,0.3160779642170538,0.30657498638352293,0.2970413513068324,0.2874780123425444,0.2778859258165868,0.2682660509296179,0.25861934966111083,0.24894678667315256,0.23924932921398243,0.2295279470212642,0.21978361222511694,0.21001729925089915,0.20022998472177053,0.19042264736102704,0.18059626789423291,0.17075182895114532,0.16089031496745576,0.15101271208634384,0.1411200080598672,0.13121319215018423,0.12129325503062975,0.11136118868665001,0.10141798631660187,0.0914646422324372,0.08150215176026912,0.0715315111408437,0.06155371742991315,0.05156976839853464,0.04158066243329049,0.031587398436453896,0.02159097572609596,0.011592393936158275,0.0015926529164868282], - [1,0.9999500004166653,0.9998000066665778,0.9995500337489875,0.9992001066609779,0.9987502603949663,0.9982005399352042,0.9975510002532796,0.9968017063026194,0.9959527330119943,0.9950041652780257,0.9939560979566968,0.9928086358538663,0.9915618937147881,0.9902159962126371,0.9887710779360422,0.9872272833756269,0.9855847669095608,0.9838436927881214,0.9820042351172703,0.9800665778412416,0.9780309147241483,0.9758974493306055,0.9736663950053749,0.9713379748520297,0.9689124217106447,0.9663899781345132,0.9637708963658905,0.9610554383107709,0.9582438755126972,0.955336489125606,0.9523335698857134,0.9492354180824408,0.946042343528387,0.9427546655283462,0.9393727128473789,0.9358968236779348,0.9323273456060345,0.9286646355765102,0.9249090598573131,0.9210609940028851,0.9171208228166051,0.9130889403123083,0.9089657496748851,0.9047516632199635,0.9004471023526769,0.8960524975255253,0.891568288195329,0.8869949227792842,0.8823328586101215,0.8775825618903728,0.8727445076457513,0.8678191796776499,0.862807070514761,0.8577086813638242,0.8525245220595057,0.8472551110134161,0.8419009751622688,0.8364626499151869,0.8309406791001636,0.8253356149096783,0.8196480178454795,0.8138784566625339,0.8080275083121519,0.8020957578842927,0.7960837985490559,0.7899922314973651,0.7838216658808492,0.7775727187509279,0.7712460149971067,0.7648421872844885,0.7583618759905082,0.751805729140895,0.7451744023448704,0.7384685587295879,0.7316888688738209,0.7248360107409052,0.7179106696109434,0.7109135380122773,0.7038453156522361,0.6967067093471654,0.689498432951747,0.6822212072876136,0.6748757600712672,0.6674628258413081,0.6599831458849822,0.6524374681640519,0.6448265472400012,0.6371511441985802,0.6294120265736969,0.6216099682706644,0.6137457494888116,0.6058201566434628,0.5978339822872982,0.5897880250310983,0.5816830894638835,0.5735199860724567,0.5652995311603544,0.5570225467662173,0.5486898605815875,0.5403023058681398,0.5318607213743555,0.5233659512516495,0.5148188449699553,0.5062202572327784,0.49757104789172696,0.4888720818605275,0.4801242290285341,0.47132836417373997,0.4624853668753008,0.4535961214255773,0.4446615167417068,0.4356824462767121,0.4266598079301574,0.4175945039583582,0.4084874408841574,0.3993395294062732,0.3901516843082303,0.38092482436688185,0.371659872260533,0.3623577544766736,0.3530194012193304,0.34364574631604705,0.3342377271245026,0.32479628443877623,0.3153223623952687,0.30581690837828934,0.29628087292531874,0.2867152096319555,0.2771208750565576,0.26749882862458735,0.2578500325326696,0.2481754516523729,0.23847605343372313,0.22875280780845939,0.2190066870930415,0.20923866589141926,0.19944972099757285,0.18964083129783446,0.17981297767299959,0.16996714290024104,0.16010431155483126,0.15022546991168584,0.14033160584673673,0.13042370873814554,0.12050276936736662,0.11056977982006959,0.10062573338693173,0.09067162446430968,0.08070844845480063,0.0707372016677029,0.0607588812193859,0.05077448493357918,0.040785011241591035,0.03079145908246612,0.020794827803092428,0.010796117058267392,0.0007963267107332633,-0.009203543268808336,-0.01920249290169265,-0.029199522301288815,-0.03919363177298771,-0.049183821914170554,-0.05916909371414814,-0.06914844865406194,-0.07912088880673386,-0.08908541693645897,-0.09904103659872801,-0.10898675223987112,-0.11892156929661223,-0.12884449429552464,-0.13875453495237755,-0.14865070027136365,-0.15853200064419776,-0.16839744794907702,-0.17824605564949209,-0.1880768388928801,-0.197888814609109,-0.2076810016087838,-0.21745242068136464,-0.2272020946930871,-0.23692904868467468,-0.24663230996883403,-0.2563109082275227,-0.2659638756089804,-0.27559024682451294,-0.28518905924502086,-0.294759352997261,-0.3043001710598332,-0.31381055935888225,-0.32328956686350335,-0.33273624568084514,-0.3421496511508982,-0.35152884194095985,-0.36087288013976715,-0.3701808313512869,-0.3794517647881545,-0.388684753364752,-0.397878873789916,-0.4070332066592655,-0.4161468365471424,-0.4252188520981522,-0.4342483461183005,-0.4432344156657089,-0.45217616214091194,-0.46107269137671275,-0.4699231137276022,-0.4787265441587198,-0.4874821023343594,-0.49618891270599885,-0.5048461045998576,-0.5134528123039594,-0.5220081751547073,-0.5305113376229448,-0.5389614493995115,-0.547357665480271,-0.5556991462506127,-0.5639850575694101,-0.5722145708524369,-0.5803868631552218,-0.5885011172553458,-0.5965565217341599,-0.6045522710579296,-0.6124875656583851,-0.6203616120126798,-0.6281736227227391,-0.6359228165940024,-0.6436084187135406,-0.6512296605275456,-0.6587857799181878,-0.666276021279824,-0.6736996355945609,-0.6810558805071525,-0.6883440203992384,-0.695563326462902,-0.7027130767735539,-0.7097925563621205,-0.7168010572865429,-0.7237378787025686,-0.7306023269338373,-0.7373937155412454,-0.7441113653915925,-0.7507546047254909,-0.7573227692245438,-0.7638152020777741,-0.7702312540473074,-0.776570283533293,-0.7828316566380653,-0.7890147472295311,-0.7951189370037843,-0.8011436155469337,-0.8070881803961459,-0.81295203709989,-0.8187345992773816,-0.8244352886772223,-0.8300535352352221,-0.8355887771314077,-0.8410404608462014,-0.8464080412157756,-0.8516909814865655,-0.8568887533689473,-0.8620008370900635,-0.8670267214458024,-0.8719659038519165,-0.8768178903942815,-0.8815821958782859,-0.886258343877352,-0.8908458667805764,-0.8953443058394921,-0.8997532112139414,-0.9040721420170612,-0.9083006663593701,-0.912438361391958,-0.9164848133487693,-0.9204396175879807,-0.9243023786324636,-0.9280727102093326,-0.9317502352885721,-0.9353345861207387,-0.9388254042737362,-0.9422223406686581,-0.9455250556146959,-0.948733218843107,-0.9518465095402424,-0.9548646163796264,-0.9577872375530904,-0.9606140808009522,-0.9633448634412433,-0.9659793123979747,-0.9685171642284466,-0.9709581651495905,-0.9733020710633487,-0.9755486475810826,-0.9776976700470132,-0.9797489235606842,-0.9817022029984541,-0.9835573130340064,-0.9853140681578838,-0.9869722926960376,-0.988531820827396,-0.9899924966004454,-0.9913541739488259,-0.9926167167059371,-0.9937799986185556,-0.9948439033594595,-0.9958083245390612,-0.9966731657160466,-0.9974383404070185,-0.9981037720951457,-0.9986693942378135,-0.9991351502732795,-0.9995009936263278,-0.9997668877129283,-0.9999328059438939,-0.9999987317275395] - ], - "format": [null, ",.2f", ",.4f", ",.4f"], - "align": "right", - "line": {"color": "grey", "width": 1}, - "font": {"family": "Arial", "size": 12, "color": ["black"]} - } - }, - { - - "type": "table", - - "domain": { - "x": [0, 0.45], - "y": [0, 0.45] - }, - - "columnwidth": [200, 300], - "columnorder": [0, 1], - - "header": { - "values": [["Trig function"], ["Double-angle form"]], - "align": ["right", "left"], - "line": {"width": 0.0}, - "fill": {"color": ["dimgray", "grey"]}, - "font": {"family": "Arial", "size": 14, "color": "white"} - }, - - "cells": { - "values": [ - ["Sine", "Cosine"], - ["$$\\sin2\\theta=2\\sin\\theta\\cos\\theta$$", "$$\\begin{eqnarray*}\\cos2\\theta&=&\\cos^2\\theta-\\sin^2\\theta\\\\&=&2\\cos^2\\theta-1\\\\&=&1-2\\sin^2\\theta\\end{eqnarray*}$$"] - ], - "align": ["right", "left"], - "line": {"color": "grey", "width": 1}, - "font": {"family": "Arial", "size": [12, 10], "color": ["black"]} - } - }, - { - - "type": "table", - - "domain": { - "x": [0.55, 1], - "y": [0, 0.45] - }, - - "columnwidth": [15, 20, 55, 65], - "columnorder": [0, 1, 2, 3], - - "header": { - "values": [["#"], ["$$\\theta$$"], ["Double-angle sine"], ["Double-angle cosine"]], - "align": "right", - "line": {"width": 0.0}, - "fill": {"color": ["dimgray", "grey"]}, - "font": {"family": "Arial", "size": 14, "color": "white"} - }, - - "cells": { - "values": [ - [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141,142,143,144,145,146,147,148,149,150,151,152,153,154,155,156,157,158,159,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255,256,257,258,259,260,261,262,263,264,265,266,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,282,283,284,285,286,287,288,289,290,291,292,293,294,295,296,297,298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314], - [0,0.02,0.04,0.06,0.08,0.1,0.12,0.14,0.16,0.18,0.2,0.22,0.24,0.26,0.28,0.3,0.32,0.34,0.36,0.38,0.4,0.42,0.44,0.46,0.48,0.5,0.52,0.54,0.56,0.58,0.6,0.62,0.64,0.66,0.68,0.7,0.72,0.74,0.76,0.78,0.8,0.82,0.84,0.86,0.88,0.9,0.92,0.94,0.96,0.98,1,1.02,1.04,1.06,1.08,1.1,1.12,1.14,1.16,1.18,1.2,1.22,1.24,1.26,1.28,1.3,1.32,1.34,1.36,1.38,1.4,1.42,1.44,1.46,1.48,1.5,1.52,1.54,1.56,1.58,1.6,1.62,1.64,1.66,1.68,1.7,1.72,1.74,1.76,1.78,1.8,1.82,1.84,1.86,1.88,1.9,1.92,1.94,1.96,1.98,2,2.02,2.04,2.06,2.08,2.1,2.12,2.14,2.16,2.18,2.2,2.22,2.24,2.26,2.28,2.3,2.32,2.34,2.36,2.38,2.4,2.42,2.44,2.46,2.48,2.5,2.52,2.54,2.56,2.58,2.6,2.62,2.64,2.66,2.68,2.7,2.72,2.74,2.76,2.78,2.8,2.82,2.84,2.86,2.88,2.9,2.92,2.94,2.96,2.98,3,3.02,3.04,3.06,3.08,3.1,3.12,3.14,3.16,3.18,3.2,3.22,3.24,3.26,3.28,3.3,3.32,3.34,3.36,3.38,3.4,3.42,3.44,3.46,3.48,3.5,3.52,3.54,3.56,3.58,3.6,3.62,3.64,3.66,3.68,3.7,3.72,3.74,3.76,3.78,3.8,3.82,3.84,3.86,3.88,3.9,3.92,3.94,3.96,3.98,4,4.02,4.04,4.06,4.08,4.1,4.12,4.14,4.16,4.18,4.2,4.22,4.24,4.26,4.28,4.3,4.32,4.34,4.36,4.38,4.4,4.42,4.44,4.46,4.48,4.5,4.52,4.54,4.56,4.58,4.6,4.62,4.64,4.66,4.68,4.7,4.72,4.74,4.76,4.78,4.8,4.82,4.84,4.86,4.88,4.9,4.92,4.94,4.96,4.98,5,5.02,5.04,5.06,5.08,5.1,5.12,5.14,5.16,5.18,5.2,5.22,5.24,5.26,5.28,5.3,5.32,5.34,5.36,5.38,5.4,5.42,5.44,5.46,5.48,5.5,5.52,5.54,5.56,5.58,5.6,5.62,5.64,5.66,5.68,5.7,5.72,5.74,5.76,5.78,5.8,5.82,5.84,5.86,5.88,5.9,5.92,5.94,5.96,5.98,6,6.02,6.04,6.06,6.08,6.1,6.12,6.14,6.16,6.18,6.2,6.22,6.24,6.26,6.28], - [0,0.03998933418663416,0.0799146939691727,0.11971220728891936,0.15931820661424598,0.19866933079506122,0.23770262642713458,0.27635564856411376,0.31456656061611776,0.35227423327508994,0.3894183423086505,0.4259394650659996,0.46177917554148284,0.49688013784373675,0.5311861979208834,0.5646424733950354,0.5971954413623921,0.6287930240184686,0.6593846719714731,0.6889214451105513,0.7173560908995228,0.7446431199708593,0.7707388788989693,0.795601620036366,0.8191915683009983,0.8414709848078965,0.8624042272433384,0.8819578068849475,0.9001004421765051,0.9168031087717669,0.9320390859672263,0.945783999449539,0.9580158602892249,0.9687151001182652,0.9778646024353163,0.9854497299884601,0.9914583481916864,0.99588084453764,0.998710143975583,0.9999417202299663,0.9995736030415051,0.9976063813191737,0.994043202198076,0.9888897660047015,0.9821543171376185,0.9738476308781951,0.9639829961524481,0.9525761942715953,0.9396454736853249,0.9252115207881683,0.9092974268256817,0.8919286509533796,0.8731329795075164,0.8529404815528762,0.8313834607786831,0.8084964038195901,0.7843159250844198,0.758880708180922,0.7322314440302514,0.7044107657701763,0.675463180551151,0.6454349983343708,0.6143742578057118,0.5823306495240819,0.5493554364271266,0.5155013718214642,0.48082261498864826,0.44537464454187115,0.4092141696720173,0.3723990394250557,0.3349881501559051,0.2970413513068324,0.25861934966111083,0.21978361222511694,0.18059626789423291,0.1411200080598672,0.10141798631660187,0.06155371742991315,0.02159097572609596,-0.01840630693305381,-0.058374143427580086,-0.09824859374510868,-0.13796586727122684,-0.17746242484086014,-0.21667508038737962,-0.2555411020268312,-0.2939983124155676,-0.3319851882207341,-0.3694409585444771,-0.4063057021444168,-0.44252044329485246,-0.47802724613534286,-0.5127693073557238,-0.5466910470692872,-0.5797381977287428,-0.6118578909427189,-0.6429987420539088,-0.6731109323435617,-0.7021462887308054,-0.7300583608392995,-0.7568024953079282,-0.7823359072266528,-0.8066177485832405,-0.8296091736113709,-0.8512734009355745,-0.8715757724135882,-0.8904838085819885,-0.9079672606164054,-0.9239981587231879,-0.9385508568851079,-0.9516020738895161,-0.9631309305733167,-0.9731189832251739,-0.9815502530915153,-0.9884112519391305,-0.9936910036334644,-0.9973810616980933,-0.999475522827284,-0.9999710363300245,-0.9988668094904142,-0.9961646088358407,-0.9918687573109126,-0.9859861273616704,-0.9785261299411385,-0.9695006994538088,-0.9589242746631385,-0.9468137755926089,-0.9331885764572976,-0.918070474669267,-0.9014836559663548,-0.8834546557201531,-0.8640123164850744,-0.8431877418564167,-0.821014246711247,-0.7975273039117043,-0.7727644875559871,-0.7467654128678123,-0.7195716728205075,-0.6912267715971271,-0.6617760549930376,-0.6312666378723216,-0.5997473287940438,-0.5672685519289686,-0.5338822663916443,-0.49964188311690244,-0.46460217941375737,-0.4288192113333959,-0.39235022399145386,-0.35525355998804264,-0.31758856607203484,-0.27941549819892586,-0.2407954251341592,-0.2017901307561289,-0.1624620152151542,-0.12287399510655005,-0.0830894028174964,-0.04317188520872868,-0.0031853017931379904,0.03680637742582692,0.07673917429251892,0.11654920485049364,0.1561727815432119,0.19554651510054427,0.23460741594807993,0.27329299497701237,0.31154136351337786,0.34929133232673487,0.38648250951987934,0.42305539714299684,0.4589514863776903,0.49411335113860816,0.5284847399429308,0.562010665900743,0.5946374946823286,0.6263130303216559,0.6569865987187891,0.6866091287076385,0.7151332305593578,0.7425132717958018,0.7687054501917558,0.7936678638491532,0.8173605782311729,0.8397456900489799,0.8607873878989017,0.8804520095530344,0.8987080958116269,0.9155264408310896,0.9308801388471136,0.9447446272181538,0.957097725720417,0.9679196720314863,0.9771931533458229,0.9849033340715608,0.9910378795642898,0.9955869758598548,0.998543345374605,0.9999022585479752,0.9996615414087742,0.9978215790530743,0.9943853150281404,0.9893582466233818,0.9827484160758622,0.974566397704435,0.9648252809930913,0.9535406496505743,0.9407305566797731,0.9264154954967662,0.9106183671457304,0.893364443662152,0.8746813276429652,0.8545989080882805,0.833149312585366,0.8103668559113548,0.7862879851369292,0.7609512213187744,0.7343970978741134,0.706668095735878,0.6778085753922867,0.6478647059195176,0.6168843911210448,0.5849171928917617,0.5520142519295329,0.5182282059209752,0.4836131053324,0.4482243269405849,0.4121184852417566,0.37535334188046277,0.3379877132432676,0.300081376365085,0.2616949732986626,0.22288991410024764,0.183728278586583,0.14427271702045727,0.10458634988363526,0.06473266689756589,0.024775425453357765,-0.015221451386431743,-0.05519397715107451,-0.09507820432636095,-0.1348103266569955,-0.17432678122297965,-0.2135643501267387,-0.2524602616282581,-0.2909522905664908,-0.32897885790632714,-0.3664791292519284,-0.4033931121687696,-0.43966175215875003,-0.4752270271347798,-0.5100320402437544,-0.5440211108893698,-0.5771398638092097,-0.6093353160635608,-0.6405559617968104,-0.6707518546358369,-0.6998746875935423,-0.7278778703497366,-0.754716603785701,-0.7803479516532316,-0.8047309092634671,-0.8278264690856537,-0.8495976831508637,-0.8700097221608728,-0.8890299312075992,-0.9066278820139979,-0.9227754216128066,-0.9374467173852933,-0.9506182983879301,-0.9622690929009016,-0.972380462138356,-0.9809362300664916,-0.9879227092817555,-0.9933287229077736,-0.997145622475965,-0.9993673017612495,-0.9999902065507035,-0.999013340329543,-0.9964382658753349,-0.9922691027578863,-0.9865125207488105,-0.9791777291513174,-0.9702764620672901,-0.9598229596252282,-0.9478339451990765,-0.9343285986543979,-0.9193285256646757,-0.9028577231468499,-0.8849425408713638,-0.865611639308158,-0.8448959437760262,-0.8228285949687089,-0.7994448959368459,-0.7747822556106337,-0.7488801289535096,-0.721779953842635,-0.6935250847771224,-0.6641607235200951,-0.6337338467854989,-0.6022931310853911,-0.5698888748578939,-0.5365729180004349,-0.5023985589369597,-0.467420469351827,-0.43169460672678167,-0.39527812482090974,-0.3582292822368287,-0.3206073492193382,-0.2824725128356853,-0.24388578068908245,-0.20490888331957058,-0.1656041754483094,-0.1260345362233393,-0.08626326862634386,-0.04635399820139722,-0.006370571267652135], - [1,0.9992001066609779,0.9968017063026194,0.9928086358538663,0.9872272833756269,0.9800665778412416,0.9713379748520297,0.9610554383107709,0.9492354180824408,0.9358968236779348,0.9210609940028851,0.9047516632199635,0.8869949227792842,0.8678191796776499,0.8472551110134161,0.8253356149096783,0.8020957578842927,0.7775727187509279,0.751805729140895,0.7248360107409052,0.6967067093471654,0.6674628258413081,0.6371511441985802,0.6058201566434628,0.5735199860724567,0.5403023058681398,0.5062202572327784,0.47132836417373997,0.4356824462767121,0.3993395294062732,0.3623577544766736,0.32479628443877623,0.2867152096319555,0.2481754516523729,0.20923866589141926,0.16996714290024104,0.13042370873814554,0.09067162446430968,0.05077448493357918,0.010796117058267392,-0.029199522301288815,-0.06914844865406194,-0.10898675223987112,-0.14865070027136365,-0.1880768388928801,-0.2272020946930871,-0.2659638756089804,-0.3043001710598332,-0.3421496511508982,-0.3794517647881545,-0.4161468365471424,-0.45217616214091194,-0.4874821023343594,-0.5220081751547073,-0.5556991462506127,-0.5885011172553458,-0.6203616120126798,-0.6512296605275456,-0.6810558805071525,-0.7097925563621205,-0.7373937155412454,-0.7638152020777741,-0.7890147472295311,-0.81295203709989,-0.8355887771314077,-0.8568887533689473,-0.8768178903942815,-0.8953443058394921,-0.912438361391958,-0.9280727102093326,-0.9422223406686581,-0.9548646163796264,-0.9659793123979747,-0.9755486475810826,-0.9835573130340064,-0.9899924966004454,-0.9948439033594595,-0.9981037720951457,-0.9997668877129283,-0.9998305895825983,-0.9982947757947531,-0.9951619033238304,-0.9904369840974732,-0.9841275769785145,-0.9762437756724099,-0.9667981925794611,-0.9558059386176664,-0.9432845990484758,-0.9292542053441233,-0.9137372031415447,-0.896758416334147,-0.878345007358874,-0.8585264337421017,-0.83733440097388,-0.8148028117859125,-0.7909677119144168,-0.7658672324346374,-0.7395415287592585,-0.7120327163983102,-0.6833848035833363,-0.6536436208636119,-0.6228567477870415,-0.5910734367830314,-0.55834453436911,-0.5247223998073464,-0.4902608213406994,-0.4550149301433047,-0.41904111212235556,-0.38239691771268025,-0.3451409698083231,-0.30733286997841935,-0.26903310311739903,-0.23030294068205867,-0.19120434267030162,-0.15179985849835556,-0.11215252693505487,-0.07232577525325448,-0.03238331775972473,0.007610946134147902,0.047593034137787815,0.0874989834394464,0.12726495303305616,0.1668273258502217,0.20612281053395834,0.24508854269136174,0.28366218546322625,0.3217820292497218,0.3593870904325897,0.39641720893592247,0.43281314446945207,0.4685166713003771,0.5034706714021142,0.5376192258309563,0.5709077041844536,0.6032828519984039,0.6346928759426347,0.6650875266792828,0.6944181792510162,0.7226379108705916,0.7497015759873071,0.7755658785102496,0.8001894410728057,0.823532871227622,0.8455588244661169,0.8662320639617282,0.8855195169413189,0.9033903275945588,0.9198159064366391,0.934769976045349,0.9482286130993458,0.9601702866503661,0.9705758925681492,0.9794287841029711,0.9867147985168921,0.9924222797411169,0.9965420970232175,0.9990676595343903,0.9999949269133752,0.9993224157301724,0.9970512018592137,0.9931849187581926,0.9877297516553079,0.9806944276542172,0.9720902017725334,0.9619308389361965,0.9502325919585296,0.9370141755392041,0.9222967363247125,0.9061038190782451,0.8884613290130915,0.8693974903498253,0.8489428011635725,0.8271299845935967,0.8039939364932571,0.7795716696040875,0.7539022543433046,0.7270267562994759,0.6989881705363377,0.6698313528098649,0.6396029478086307,0.6083513145322546,0.576126448927319,0.5429799039045207,0.5089647068650102,0.47413527486786244,0.43854732757439036,0.4022577981085728,0.3653247419762019,0.32780724418845836,0.2897653247384949,0.2512598425822557,0.21235239827712596,0.17310523543418174,0.13358114114169023,0.09384334551916232,0.05395542056264975,0.013981178443112786,-0.026015430579440828,-0.06597042046272987,-0.10581987174621767,-0.14550003380861354,-0.18494742685526652,-0.22409894347229967,-0.26289194958500034,-0.3012643846589916,-0.3391548609838345,-0.3765027618802833,-0.41324833867402755,-0.4493328062808388,-0.4846984372501522,-0.5192886541166856,-0.5530481199123021,-0.585922826693367,-0.6178601819419246,-0.6488090927025189,-0.6787200473200125,-0.7075451946476833,-0.7352384205988414,-0.7617554219195404,-0.7870537770643236,-0.811093014061656,-0.8338346752604369,-0.8552423788540459,-0.8752818770834644,-0.8939211110263924,-0.9111302618846769,-0.9268817986880358,-0.9411505223377324,-0.9539136059197585,-0.9651506312230295,-0.9748436214041636,-0.9829770697465994,-0.9895379644680314,-0.9945158095364889,-0.9979026414617453,-0.9996930420352065,-0.9998841469978862,-0.9984756506226111,-0.9954698062031188,-0.9908714224492672,-0.984687855794127,-0.9769289986252552,-0.9676072634589881,-0.95673756308306,-0.9443372866993279,-0.9304262721047533,-0.9150267739551639,-0.8981634281625465,-0.8798632124828492,-0.8601554033573197,-0.8390715290764524,-0.8166453193414427,-0.7929126513038623,-0.7679114921698745,-0.7416818384607952,-0.7142656520272002,-0.6857067929189065,-0.6560509492182578,-0.6253455639489304,-0.5936397591772248,-0.5609842574272288,-0.5274313005356096,-0.49303456607580864,-0.4578490814853859,-0.42193113603384647,-0.3853381907718296,-0.3481287866056728,-0.3103624506444623,-0.2720996009693438,-0.23340144997749526,-0.1943299064553348,-0.15494747653768326,-0.11531716371126842,-0.07550236802260023,-0.035566784651406926,0.004425697988050785,0.04441110045482617,0.08432545463473841,0.12410490607570422,0.16368581614125197,0.2030048638187504,0.24199914701953518,0.28060628320881836,0.31876450920445026,0.35641277998482196,0.3934908663478909,0.42993945126504285,0.46570022477569695,0.5007159772707912,0.5349306910159652,0.5682896297679736,0.60073942634101,0.6322281679828087,0.6627054794239857,0.6921226034677119,0.7204324789908387,0.7475898162316443,0.7735511692438023,0.7982750054006175,0.8217217718383782,0.8438539587324921,0.864636159305211,0.8840351264689191,0.9020198260143784,0.9185614862588488,0.9336336440746373,0.947212187224462,0.9592753929358835,0.9698039626531111,0.9787810529105713,0.9861923022788637,0.9920258543399803,0.9962723766550488,0.9989250756942408,0.9999797077049732] - ], - "format": [null, ",.2f", ",.4f", ",.4f"], - "align": "right", - "line": {"color": "grey", "width": 1}, - "font": {"family": "Arial", "size": 12, "color": ["black"]} - } - } - - ] -} diff --git a/test/image/mocks/table_latex_multitrace_scatter.json b/test/image/mocks/table_latex_multitrace_scatter.json index a62d6293622..e2aa1475f03 100644 --- a/test/image/mocks/table_latex_multitrace_scatter.json +++ b/test/image/mocks/table_latex_multitrace_scatter.json @@ -25,7 +25,7 @@ "header": { "values": [["#"], ["Half-angle form"], ["Equivalent"]], "align": ["right", "center", "center"], - "line": {"width": 0.0}, + "line": {"width": 1, "color": ["dimgray", "grey"]}, "fill": {"color": ["dimgray", "grey"]}, "font": {"family": "Arial", "size": 14, "color": "white"} }, @@ -55,7 +55,7 @@ "header": { "values": [["#"], ["$$\\theta$$"], ["Half-angle sine"], ["Half-angle cosine"]], "align": "right", - "line": {"width": 0.0}, + "line": {"width": 1, "color": ["dimgray", "grey"]}, "fill": {"color": ["dimgray", "grey"]}, "font": {"family": "Arial", "size": 14, "color": "white"} }, @@ -88,7 +88,7 @@ "header": { "values": [["Trig function"], ["Double-angle form"]], "align": ["right", "left"], - "line": {"width": 0.0}, + "line": {"width": 1, "color": ["dimgray", "grey"]}, "fill": {"color": ["dimgray", "grey"]}, "font": {"family": "Arial", "size": 14, "color": "white"} }, @@ -117,7 +117,7 @@ "header": { "values": [["#"], ["$$\\theta$$"], ["Double-angle sine"], ["Double-angle cosine"]], "align": "right", - "line": {"width": 0.0}, + "line": {"width": 1, "color": ["dimgray", "grey"]}, "fill": {"color": ["dimgray", "grey"]}, "font": {"family": "Arial", "size": 14, "color": "white"} }, diff --git a/test/image/mocks/table_plain_birds.json b/test/image/mocks/table_plain_birds.json index 45881c35bac..39b8cee83ee 100644 --- a/test/image/mocks/table_plain_birds.json +++ b/test/image/mocks/table_plain_birds.json @@ -25,10 +25,7 @@ "align": ["right", "left", "right", "right", "left", "left", "left"], - "line": { - "color": "lightgray", - "width": 0.0 - }, + "line": {"width": 1, "color": ["dimgray", "grey"]}, "fill": { "color": ["dimgray", "grey"] diff --git a/test/image/mocks/table_ragged.json b/test/image/mocks/table_ragged.json new file mode 100644 index 00000000000..439c08a3d79 --- /dev/null +++ b/test/image/mocks/table_ragged.json @@ -0,0 +1,13 @@ +{ + "data": [{ + "type": "table", + "header": {"values": ["z", ["a","b"], ["c"], []], + "line": {"width": 4}}, + "cells": { + "values": [[1],[2,3],4,[],[5]], + "fill": {"color": "#eee"}, + "line": {"width": [[1,9],[3,7],[5,5],[7,3],[9,1]]} + } + }], + "layout": {"width": 400, "height": 400} +} diff --git a/test/image/mocks/table_wrapped_birds.json b/test/image/mocks/table_wrapped_birds.json index 1ae78dab636..0b627ca342b 100644 --- a/test/image/mocks/table_wrapped_birds.json +++ b/test/image/mocks/table_wrapped_birds.json @@ -25,10 +25,7 @@ "align": ["right", "left", "right", "right", "left", "left", "left"], - "line": { - "color": "lightgray", - "width": 0.0 - }, + "line": {"width": 1, "color": ["dimgray", "grey"]}, "fill": { "color": ["dimgray", "grey"] diff --git a/test/jasmine/tests/table_test.js b/test/jasmine/tests/table_test.js index ab5d988f020..2f58b7f2061 100644 --- a/test/jasmine/tests/table_test.js +++ b/test/jasmine/tests/table_test.js @@ -8,7 +8,7 @@ var createGraphDiv = require('../assets/create_graph_div'); var destroyGraphDiv = require('../assets/destroy_graph_div'); var supplyAllDefaults = require('../assets/supply_defaults'); -var mockMulti = require('@mocks/table_latex_multitrace.json'); +var mockMulti = require('@mocks/table_latex_multitrace_scatter.json'); // mock with two columns; lowest column count of general case var mock2 = Lib.extendDeep({}, mockMulti); @@ -305,7 +305,7 @@ describe('table', function() { expect(gd.data[0].header.fill.color).toEqual('magenta'); expect(gd.data[0].header.values.length).toEqual(7); expect(gd.data[0].cells.values.length).toEqual(7); - expect(gd.data[0].header.line.color).toEqual('lightgray'); // no change relative to original mock value + expect(gd.data[0].header.line.color).toEqual(['dimgray', 'grey']); // no change relative to original mock value expect(gd.data[0].cells.line.color).toEqual(['grey']); // no change relative to original mock value done();