8000 Table view - squashed by monfera · Pull Request #2052 · plotly/plotly.js · GitHub
[go: up one dir, main page]

Skip to content

Table view - squashed #2052

8000
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 44 commits into from
Oct 5, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
c4244db
table - initial commit (squashed feature branch)
monfera Oct 3, 2017
865e444
adding birds mock
monfera Oct 3, 2017
2648e51
minor mock change
monfera Oct 3, 2017
1922721
avoid crispEdges in cell contents and scrollbar; minor mock change
monfera Oct 3, 2017
30cbaa0
doc change
monfera Oct 3, 2017
aa0c116
fewer accessor uses
monfera Oct 3, 2017
c0ac213
doc update
monfera Oct 3, 2017
732bd46
more idiomatic D3
monfera Oct 3, 2017
22e23e3
no prefixing with window
monfera Oct 3, 2017
9571be3
amending document
monfera Oct 3, 2017
345b027
switched off bounciness
monfera Oct 3, 2017
ff3c8f6
minor mock fix
monfera Oct 3, 2017
b9c8de6
staying valign for the moment
monfera Oct 4, 2017
c1d19b4
fixes non-wrapping wrappable case by including it in the `alignment-b…
monfera Oct 4, 2017
f8e7647
mock update - showing text wrapping
monfera Oct 4, 2017
7186527
separate mock for wrapped text; fixing a scrolling issue
monfera Oct 4, 2017
e96c3c4
adding editType (for now, conservatively)
monfera Oct 4, 2017
5336725
new mock
monfera Oct 4, 2017
6f21697
adding multitrace latex mock; fixing multitrace drag bug
monfera Oct 4, 2017
f3f1a5d
fixing multitrace drag bug 2
monfera Oct 4, 2017
9574099
fixing multitrace drag bug 3
monfera Oct 4, 2017
5a59e04
fixing multitrace drag bug 4
monfera Oct 4, 2017
dd5841d
multitrace mock with scrollers to show trace independence
monfera Oct 4, 2017
9b60156
new mock: adding scatter plot to trace
monfera Oct 4, 2017
309c8bb
moving functionality from `calc.js` to a helper file
monfera Oct 4, 2017
78cb5ec
moving functionality from `plot.js` to the data split file
monfera Oct 4, 2017
b14f6c6
mock JSON consolidated to fewer items
monfera Oct 5, 2017
2be591f
removed clipView debug option
monfera Oct 5, 2017
addb85b
allow cell text selection
monfera Oct 5, 2017
c2f251f
fixing server image gen issue - thanks Étienne - and removing the pos…
monfera Oct 5, 2017
3cab51d
adding baselines
monfera Oct 5, 2017
fa84c68
globally safe clipPath #1
monfera Oct 5, 2017
465b45b
use overrideAll in table attributes
etpinard Oct 5, 2017
0fa1cc8
globally safe clipPath #2
monfera Oct 5, 2017
cd0578d
Merge branch 'table-squashed' of https://github.com/plotly/plotly.js …
monfera Oct 5, 2017
a6c4935
add baselines
etpinard Oct 5, 2017
0ad1a0c
preparing for user-specified stroke/stroke-opacity, fill/fill-opacity…
monfera Oct 5, 2017
1254c9f
user-specified stroke/stroke-opacity, fill/fill-opacity setting via C…
monfera Oct 5, 2017
e38b7cf
Merge branch 'table-squashed' of https://github.com/plotly/plotly.js …
monfera Oct 5, 2017
94338f4
Merge branch 'table-textselect' into table-squashed
monfera Oct 5, 2017
6288559
minor simplification before rewiring event handlers to enable text copy
monfera Oct 5, 2017
154ab24
allow both dragging and text cell copying
monfera Oct 5, 2017
9402020
disable visible scrollbar on initial load
monfera Oct 5, 2017
d4f0ed7
updating other mocks
monfera Oct 5, 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
fixing multitrace drag bug 2
  • Loading branch information
monfera committed Oct 4, 2017
commit f3f1a5df403442389bc3075e5d357098e4641816
12 changes: 7 additions & 5 deletions src/traces/table/plot.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,9 +108,7 @@ module.exports = function plot(gd, calcdata) {
var getter = function(dd) {return (d === dd ? d3.event.x : dd.x) + dd.columnWidth / 2;};
d.x = Math.max(-c.overdrag, Math.min(d.calcdata.width + c.overdrag - d.columnWidth, d3.event.x));

var sortableColumns = [].concat.apply([], yColumn.map(function(g) {return g;}))
.map(function(g) {return g.__data__})
.filter(function(dd) {return dd.calcdata.key === d.calcdata.key});
var sortableColumns = flatData(yColumn).filter(function(dd) {return dd.calcdata.key === d.calcdata.key});
var newOrder = sortableColumns.sort(function(a, b) {return getter(a) - getter(b);});
newOrder.forEach(function(dd, i) {
dd.xIndex = i;
Expand Down Expand Up @@ -234,6 +232,11 @@ module.exports = function plot(gd, calcdata) {
updateBlockYPosition(null, cellsColumnBlock, tableControlView);
};

function flatData(selection) {
return [].concat.apply([], selection.map(function(g) {return g;}))
.map(function(g) {return g.__data__});
}

function renderScrollbarKit(tableControlView, gd) {
8000
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Another scroller. That's now three separate implementations (legend, update menus and this here). 😡

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree with your sentiment... I looked into these scrollers and didn't find an easy way for either using them or reworking them to cover the table use case, it's an infinite revolver scroller, our discussion: #1834 (comment)

As the scrollbars and event captures didn't take much time and there were more difficult issues, I spent < 1 day putting in the scrollbars remembering that maybe you or us would check how unification could be done. I'd have spent a lot more time trying to unify while the core of table also wasn't stable so it was a risk reduction tradeoff (maybe a bad tradeoff on my part).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That 😡 wasn't meant for you. Adding a separate scroller for table at this stage was definitively the correct decision.

It's just one big tech-debt that we'll have to pay back soon (I hope) 💰

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Separate item: #2054


function calcTotalHeight(d) {
Expand Down Expand Up @@ -745,8 +748,7 @@ function updateBlockYPosition(gd, cellsColumnBlock, tableControlView) {
}

function makeDragRow(gd, tableControlView, optionalMultiplier, optionalPosition) {
return function dragRow() {
var d = tableControlView.node().__data__;
return function dragRow(d) {
var multiplier = optionalMultiplier || d.scrollbarState.dragMultiplier;
d.scrollY = optionalPosition === void(0) ? d.scrollY + multiplier * d3.event.dy : optionalPosition;
var cellsColumnBlock = tableControlView.selectAll('.yColumn').selectAll('.columnBlock').filter(cellsBlock);
Expand Down
2 changes: 1 addition & 1 deletion test/image/mocks/table_latex_multitrace.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"layout": {
"width": 620,
"height": 560,
"height": 400,
"title": "Half and Double Angles"
},

Expand Down
0