Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Treemap new trace type #4185

Merged
merged 63 commits into from
Sep 25, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
63 commits
Select commit Hold shift + click to select a range
ec6a9de
bar textpad const
archmoj Aug 28, 2019
52ded31
refactor base_plot files
archmoj Aug 29, 2019
320f81a
changes to sunburst attributes - add percentages - add colorscale and…
archmoj Aug 29, 2019
06d93ae
prep to add treemap to the lib
archmoj Aug 29, 2019
6cc8590
treemap mocks
archmoj Aug 28, 2019
6a595b6
treemap jasmine tests
archmoj Aug 28, 2019
671e864
treemap code
archmoj Sep 11, 2019
648167d
correct current path when there is no parent
archmoj Sep 11, 2019
6dad958
various attribute revisions
archmoj Sep 13, 2019
cceee49
drop stroke-linejoin
archmoj Sep 13, 2019
f3d38b8
revisit pathbar draw as well as transition
archmoj Sep 13, 2019
088b0e0
revert sunburst hoverinfo defaults
archmoj Sep 13, 2019
e23a577
move attachFxHandlers to fx.js
archmoj Sep 13, 2019
eb54f24
pass hover and transition options to fx
archmoj Sep 13, 2019
0e3185f
expand setSliceCursor logic to handle treemap and pathbar cases
archmoj Sep 13, 2019
fdd69e7
drop stroke-linejoin again
archmoj Sep 13, 2019
a7b6074
use constant _hoverd.marker.line.width - improve a treemap mock and u…
archmoj Sep 14, 2019
4c85360
correct transition of text inside pathbar namely when side is bottom
archmoj Sep 14, 2019
65c0e02
display percent of root on leaf when it is an entry
archmoj Sep 14, 2019
ca4b385
some refRect clean up and rename interpolator functions in sunburst a…
archmoj Sep 14, 2019
0012fa1
make the opacity logic slightly more user-friendly by applying leaf.o…
archmoj Sep 14, 2019
544977e
thanks to a typo leading to apply a better easing option suitable for…
archmoj Sep 14, 2019
13e0449
dont use sunburst naming in treemap
archmoj Sep 14, 2019
57dec38
move getTransform function to Lib and use it in bar and treemap
archmoj Sep 14, 2019
65f0213
correct exit case of zoom out when maxdepth is set - avoid overlaps a…
archmoj Sep 15, 2019
ad24987
when exiting with maxdepth try to use parent if that is visible on th…
archmoj Sep 16, 2019
36fb510
early exit out of maxdepth elements for better transitions and avoid …
archmoj Sep 16, 2019
284bf6d
add constant zero fillet - could expose that in next version
archmoj Sep 16, 2019
4e2c328
add default tests of treemap and sunburst
archmoj Sep 16, 2019
0cf5bf6
remove the case that never happens now
archmoj Sep 16, 2019
2405ba4
revisit pathbar divider default
archmoj Sep 16, 2019
19c7a61
[wip] add test for sunburst tween edge cases
etpinard Sep 17, 2019
4e3b7f3
address various treemap transition case e.g. maxdepth, tweening and p…
archmoj Sep 19, 2019
e5181ac
texttemplate and other fixes for treemap and sunburst
archmoj Sep 19, 2019
e9c0202
add calc test for count branches and leaves
archmoj Sep 19, 2019
e4bc91e
treemap drop leaf.opacity
archmoj Sep 19, 2019
a54ca9c
better description regarding the position of pathbar also move the ga…
archmoj Sep 19, 2019
d7b06a1
change divider to edgeshape
archmoj Sep 19, 2019
c91f9db
revisit ancestors draw - avoid overlaps - end pathbar with edgeshape
archmoj Sep 19, 2019
ceb13f7
tween and animate text for new points on pathbar from their parent
archmoj Sep 19, 2019
1270d67
draw new points of pathbar below parents (to avoid text overlay) - im…
archmoj Sep 20, 2019
35ea4b3
correct current path function - reuse listPath in helpers i.e. to hav…
archmoj Sep 20, 2019
1de80d9
add mock to test with and without values - and pathbar fade with depth
archmoj Sep 20, 2019
e7e22c6
texttemplate and hovertemplate fixes
archmoj Sep 20, 2019
6130f96
rename key to
archmoj Sep 20, 2019
e3a8e91
check for falsy 0 numbers when searching for level and ids
archmoj Sep 20, 2019
14674d6
handle hover edge cases
archmoj Sep 20, 2019
01c5f68
use onPathbar everywhere referring to points on pathbar - this make l…
archmoj Sep 20, 2019
4c7a092
revisit marker opacities: no opacity with colorscale, now having
archmoj Sep 21, 2019
1860826
improve sunburst texttemplate tests - drop the comment for a fixed tr…
archmoj Sep 22, 2019
d2b07b5
improve mocks to show various percentage values and colorscale using …
archmoj Sep 22, 2019
1fdf574
correct displaying percentages
archmoj Sep 23, 2019
3004a9a
fix more percentage edge cases - handle branchvalues remainder
archmoj Sep 23, 2019
4d790a1
correct texttemplate and hover
archmoj Sep 23, 2019
1c6e47b
dont touch pt.parent
archmoj Sep 23, 2019
e339bf5
Avoid using random ids in recording position of empty root
archmoj Sep 23, 2019
1309bfd
improve treemap jasmine tests
archmoj Sep 23, 2019
217c0f4
revisit sunburst and treemap percentages
archmoj Sep 24, 2019
8416883
rework working with parent references in hover and plot
archmoj Sep 24, 2019
c918da9
Reference fixups
archmoj Sep 25, 2019
7d67c7a
try to make parent getter more consistent by using pt.data.data.pid i…
archmoj Sep 25, 2019
f8cef49
add tolerance to tween tests
etpinard Sep 25, 2019
3c12bf6
remove unnecessary check for NaNs
archmoj Sep 25, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions tasks/test_syntax.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,12 +140,15 @@ function assertSrcContents() {
} else if(IE_BLACK_LIST.indexOf(lastPart) !== -1) {
logs.push(file + ' : contains .' + lastPart + ' (IE failure)');
} else if(IE_SVG_BLACK_LIST.indexOf(lastPart) !== -1) {
// add special case for sunburst where we use 'children'
// add special case for sunburst and treemap where we use 'children'
// off the d3-hierarchy output
var dirParts = path.dirname(file).split(path.sep);
var isSunburstFile = dirParts[dirParts.length - 1] === 'sunburst';
var isLinkedToObject = ['pt', 'd', 'parent'].indexOf(parts[parts.length - 2]) !== -1;
if(!(isSunburstFile && isLinkedToObject)) {
var filename = dirParts[dirParts.length - 1];
var isSunburstOrTreemap =
filename === 'sunburst' ||
filename === 'treemap';
var isLinkedToObject = ['pt', 'd', 'parent', 'node'].indexOf(parts[parts.length - 2]) !== -1;
if(!(isSunburstOrTreemap && isLinkedToObject)) {
logs.push(file + ' : contains .' + lastPart + ' (IE failure in SVG)');
}
} else if(FF_BLACK_LIST.indexOf(lastPart) !== -1) {
Expand Down
1 change: 1 addition & 0 deletions test/jasmine/assets/mock_lists.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var svgMockList = [
['range_slider_multiple', require('@mocks/range_slider_multiple.json')],
['sankey_energy', require('@mocks/sankey_energy.json')],
['sunburst_coffee', require('@mocks/sunburst_coffee.json')],
['treemap_coffee', require('@mocks/treemap_coffee.json')],
['parcats_bad-displayindex', require('@mocks/parcats_bad-displayindex.json')],
['scattercarpet', require('@mocks/scattercarpet.json')],
['shapes', require('@mocks/shapes.json')],
Expand Down
36 changes: 36 additions & 0 deletions test/jasmine/tests/plot_api_react_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,42 @@ describe('Plotly.react and uirevision attributes', function() {
.catch(failTest)
.then(done);
});

it('preserves treemap level changes', function(done) {
function assertLevel(msg, exp) {
expect(gd._fullData[0].level).toBe(exp, msg);
}

Plotly.react(gd, [{
type: 'treemap',
labels: ['Eve', 'Cain', 'Seth', 'Enos', 'Noam', 'Abel', 'Awan', 'Enoch', 'Azura'],
parents: ['', 'Eve', 'Eve', 'Seth', 'Seth', 'Eve', 'Eve', 'Awan', 'Eve'],
uirevision: 1
}])
.then(function() {
assertLevel('no set level at start', undefined);
})
.then(function() {
var nodeSeth = d3.select('.slice:nth-child(2)').node();
mouseEvent('click', 0, 0, {element: nodeSeth});
})
.then(function() {
assertLevel('after clicking on Seth sector', 'Seth');
})
.then(function() {
return Plotly.react(gd, [{
type: 'treemap',
labels: ['Eve', 'Cain', 'Seth', 'Enos', 'Noam', 'Abel', 'Awan', 'Enoch', 'Azura', 'Joe'],
parents: ['', 'Eve', 'Eve', 'Seth', 'Seth', 'Eve', 'Eve', 'Awan', 'Eve', 'Seth'],
uirevision: 1
}]);
})
.then(function() {
assertLevel('after reacting with new data, but with same uirevision', 'Seth');
})
.catch(failTest)
.then(done);
});
});

describe('Test Plotly.react + interactions under uirevision:', function() {
Expand Down
Loading