Skip to content

make offsetgroup work with barmode 'stacked' and 'relative' for bar traces #7009

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

Merged
merged 27 commits into from
Oct 22, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
d3b5068
For bar traces make offsetgroup work with barmode 'stacked' and 'rela…
my-tien Jun 1, 2024
6ce9aa6
Fix handleGroupingDefaults calls outside of bar/defaults.js
my-tien Jun 3, 2024
7664219
Fix linter error on missing newline at EOF
my-tien Jun 3, 2024
ed7d541
Fix offset calculation and stacking for barpolar
my-tien Jun 4, 2024
24b4fb5
Fix angularaxis check in setOffsetAndWidth
my-tien Jun 5, 2024
c91f06c
consider modes of other traces as well (scattermode, funnelmode,... )
my-tien Jun 5, 2024
724c83f
Don't use poffset for sieve.put, use trace._offsetIndex instead.
my-tien Jun 5, 2024
315c888
Fix logic for adding a gap between bars
my-tien Jun 5, 2024
c6f5dbe
baseline image for zzz_bar_relative_offsetgroup
my-tien Jun 5, 2024
86478a4
Fix sieve for offsetgroups
my-tien Jun 6, 2024
2d9d0a9
Fix for failing baseline test waterfall_funnel_template_date
my-tien Jun 6, 2024
8caa69b
Pass missing barmode param for histogram
my-tien Jun 6, 2024
68fae33
Ensure offsetIndex and offsetgroup are not undefined
my-tien Jun 6, 2024
e8bd5db
Track alignmentgroups in fullLayout._alignmentOpts by trace type
my-tien Jun 7, 2024
ac93f5d
Make offsetgroup work for boxmode overlay as well
my-tien Jun 7, 2024
e43227c
Documentation for setOffsetAndWidth and fix for sieve documentations
my-tien Jun 7, 2024
14e92a3
Merge remote-tracking branch 'origin-plotly/master' into barmode_rela…
my-tien Jun 7, 2024
960f910
Merge remote-tracking branch 'origin-plotly/master' into barmode_rela…
my-tien Aug 28, 2024
f08f925
Revert "Make offsetgroup work for boxmode overlay as well"
my-tien Aug 28, 2024
d855f17
Revert "Track alignmentgroups in fullLayout._alignmentOpts by trace t…
my-tien Aug 28, 2024
b3ac3c9
Ignore offsetgroup and alignmentgroup for those trace types that don'…
my-tien Aug 28, 2024
db602ab
Update funnel test after adding support for alignmentgroup and offset…
my-tien Sep 2, 2024
9f3624d
Update bar test after adding support for alignmentgroup and offsetgro…
my-tien Sep 2, 2024
2059f80
Update baseline images for legendgroup_bar-stack and funnel_attrs
my-tien Sep 4, 2024
bc2ea29
Merge remote-tracking branch 'origin-plotly/master' into barmode_rela…
my-tien Sep 10, 2024
0bd1313
Merge branch 'master' into barmode_relative_offsetgroup
archmoj Oct 22, 2024
5ad372b
PR log
archmoj Oct 22, 2024
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
Prev Previous commit
Next Next commit
consider modes of other traces as well (scattermode, funnelmode,... )
  • Loading branch information
my-tien committed Jun 5, 2024
commit c91f06cd26c55c51ab808848d1b9a0e3db9d5583
4 changes: 1 addition & 3 deletions src/traces/box/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -303,9 +303,7 @@ function crossTraceDefaults(fullData, fullLayout) {

if(traceType === 'box' || traceType === 'violin') {
traceIn = traceOut._input;
if(fullLayout[traceType + 'mode'] === 'group') {
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);
}
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce, fullLayout[traceType + 'mode']);
}
}
}
Expand Down
11 changes: 4 additions & 7 deletions src/traces/funnel/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,10 @@ function crossTraceDefaults(fullData, fullLayout) {
return Lib.coerce(traceOut._input, traceOut, attributes, attr);
}

if(fullLayout.funnelmode === 'group') {
for(var i = 0; i < fullData.length; i++) {
traceOut = fullData[i];
traceIn = traceOut._input;

handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);
}
for(var i = 0; i < fullData.length; i++) {
traceOut = fullData[i];
traceIn = traceOut._input;
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce, fullLayout.funnelmode);
}
}

Expand Down
12 changes: 5 additions & 7 deletions src/traces/scatter/cross_trace_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ module.exports = function crossTraceDefaults(fullData, fullLayout) {
return Lib.coerce(traceOut._input, traceOut, attributes, attr);
}

if(fullLayout.scattermode === 'group') {
for(i = 0; i < fullData.length; i++) {
traceOut = fullData[i];
for(i = 0; i < fullData.length; i++) {
traceOut = fullData[i];

if(traceOut.type === 'scatter') {
traceIn = traceOut._input;
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);
}
if(traceOut.type === 'scatter') {
traceIn = traceOut._input;
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce, fullLayout.scattermode);
}
}

Expand Down
3 changes: 1 addition & 2 deletions src/traces/scatter/grouping_defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ module.exports = function handleGroupingDefaults(traceIn, traceOut, fullLayout,
var offsetGroupOpts = offsetGroups[offsetgroup];
// in barmode 'group', traces without offsetgroup receive their own offsetgroup
// in other barmodes, traces without offsetgroup are assigned to the same offset group
var isBarTrace = traceOut.type === 'bar' || traceOut.type === 'waterfall';
if((isBarTrace && barmode !== 'group') || offsetgroup) {
if(barmode !== 'group' || offsetgroup) {
if(!offsetGroupOpts) {
offsetGroupOpts = offsetGroups[offsetgroup] = {
offsetIndex: Object.keys(offsetGroups).length
Expand Down
10 changes: 4 additions & 6 deletions src/traces/waterfall/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,11 @@ function crossTraceDefaults(fullData, fullLayout) {
return Lib.coerce(traceOut._input, traceOut, attributes, attr);
}

if(fullLayout.waterfallmode === 'group') {
for(var i = 0; i < fullData.length; i++) {
traceOut = fullData[i];
traceIn = traceOut._input;
for(var i = 0; i < fullData.length; i++) {
traceOut = fullData[i];
traceIn = traceOut._input;

handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce);
}
handleGroupingDefaults(traceIn, traceOut, fullLayout, coerce, fullLayout.waterfallmode);
}
}

Expand Down