8000 [take 2] Implement scatter `cliponaxis: false` by etpinard · Pull Request #1861 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content
8000

[take 2] Implement scatter cliponaxis: false #1861

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 21 commits into from
Jul 13, 2017
Merged
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
c28b26a
lint in drawing/
etpinard Jul 7, 2017
8f72d1f
implement cliponaxis
etpinard Jul 7, 2017
1909034
hide outside range points on drag and transitions
etpinard Jul 7, 2017
4b5c4bb
implement `cliponaxis: false` for scatterternary
etpinard Jul 7, 2017
d46cae7
merge custom shared assertions into single assets/ module
etpinard Jul 7, 2017
7228d5d
add cliponaxis false mock
etpinard Jul 7, 2017
fe1f889
showcase new cliponaxis logic in ternary_markers
etpinard Jul 7, 2017
89ee533
add scatter and scatterternary cliponaxis tests
etpinard Jul 7, 2017
e4d7889
fix panning for ternary lines under `cliponaxis: false`
etpinard Jul 7, 2017
091473b
fix lint
etpinard Jul 10, 2017
9becb7c
hide points using `display: 'none'` instead of visibility attr
etpinard Jul 11, 2017
62ab845
remove obsolete code from old d.{xp|yp} optimization attempt
etpinard Jul 11, 2017
0496144
stash layer clipId value (null or same as clipId)
etpinard Jul 11, 2017
7b62b73
handle cliponaxis false/true traces coexisting on same subplot
etpinard Jul 11, 2017
02b9fbc
rename 'layers' cartesian constant -> 'traceLayerClasses'
etpinard Jul 11, 2017
1c85de6
add 'layer' axis attribute
etpinard Jul 11, 2017
e44aa4d
improve cliponaxis_false mock
etpinard Jul 11, 2017
e84701f
replace strict-d3 IIFE with browserify 'require' transform
etpinard Jul 12, 2017
e234827
fixes #1873 - apply transform on <clipPath> child
etpinard Jul 12, 2017
6f494c6
talk about 'cliponaxis' in axis 'layer' description and vice-versa
etpinard Jul 12, 2017
bbb31f4
Merge pull request #1871 from plotly/axis-layer-above-below
etpinard Jul 13, 2017
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
handle cliponaxis false/true traces coexisting on same subplot
  • Loading branch information
etpinard committed Jul 11, 2017
commit 7b62b73d9cc89c14c0a1167076ddeeb71b135eda
14 changes: 10 additions & 4 deletions src/traces/scatter/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,8 +404,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
var trace = d[0].trace,
s = d3.select(this),
showMarkers = subTypes.hasMarkers(trace),
showText = subTypes.hasText(trace),
hasClipOnAxisFalse = trace.cliponaxis === false;
showText = subTypes.hasText(trace);

var keyFunc = getKeyFunc(trace),
markerFilter = hideFilter,
Expand Down Expand Up @@ -450,7 +449,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
if(hasNode) {
Drawing.singlePointStyle(d, sel, trace, markerScale, lineScale, gd);

if(hasClipOnAxisFalse) {
if(plotinfo.layerClipId) {
Drawing.hideOutsideRangePoint(d, sel, xa, ya);
}

Expand Down Expand Up @@ -486,7 +485,7 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
hasNode = Drawing.translatePoint(d, sel, xa, ya);

if(hasNode) {
if(hasClipOnAxisFalse) {
if(plotinfo.layerClipId) {
Drawing.hideOutsideRangePoint(d, g, xa, ya);
}
} else {
Expand Down Expand Up @@ -525,6 +524,13 @@ function plotOne(gd, idx, plotinfo, cdscatter, cdscatterAll, element, transition
.each(makePoints);

join.exit().remove();

// lastly, clip points groups of `cliponaxis !== false` traces
// on `plotinfo._hasClipOnAxisFalse === true` subplots
join.each(function(d) {
var hasClipOnAxisFalse = d[0].trace.cliponaxis === false;
Drawing.setClipUrl(d3.select(this), hasClipOnAxisFalse ? null : plotinfo.layerClipId);
});
}

function selectMarkers(gd, idx, plotinfo, cdscatter, cdscatterAll) {
Expand Down
0