8000 allows rendering of container positionied images · lutzer/epoch-plotly.js@f880c8a · GitHub
[go: up one dir, main page]

Skip to content

Commit f880c8a

Browse files
committed
allows rendering of container positionied images
1 parent b6411b5 commit f880c8a

File tree

4 files changed

+17
-2
lines changed

4 files changed

+17
-2
lines changed

EPOCH_README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# EPOCH README
2+
3+
## Set up development environment
4+
5+
* use node 16: `nvm use 16`
6+
* install canvas support libs with `brew install pkg-config cairo pango libpng jpeg giflib librsvg`
7+
* follow instructions in [CONTRIBUTING.md#Development](CONTRIBUTING.md#Development)

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
},
7373
"dependencies": {
7474
"@plotly/d3": "3.8.2",
75-
"@plotly/d3-sankey": "0.7.2",
75+
"@plotly/d3-sankey": "^0.7.3",
7676
"@plotly/d3-sankey-circular": "0.33.1",
7777
"@plotly/mapbox-gl": "1.13.4",
7878
"@turf/area": "^6.4.0",
@@ -99,6 +99,7 @@
9999
"has-hover": "^1.0.1",
100100
"has-passive-events": "^1.0.0",
101101
"is-mobile": "^4.0.0",
102+
"mathjax": "^3.2.2",
102103
"mouse-change": "^1.4.0",
103104
"mouse-event-offset": "^3.0.2",
104105
"mouse-wheel": "^1.2.0",
@@ -157,7 +158,7 @@
157158
"karma-viewport": "1.0.2",
158159
"karma-webpack": "^5.0.0",
159160
"lodash": "^4.17.21",
160-
"madge": "^6.1.0",
161+
"madge": "^0.6.0",
161162
"mathjax-v2": "npm:mathjax@2.7.5",
162163
"mathjax-v3": "npm:mathjax@^3.2.2",
163164
"minify-stream": "^2.1.0",

src/components/images/draw.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,8 @@ module.exports = function draw(gd) {
155155
xPos = ((typeof(d.xref) === 'string') && xIsDomain) ?
156156
xa._length * d.x + xa._offset :
157157
xa.r2p(d.x) + xa._offset;
158+
} else if (d.xref == "container") {
159+
xPos = d.x * fullLayout.width;
158160
} else {
159161
xPos = d.x * size.w + size.l;
160162
}
@@ -165,11 +167,15 @@ module.exports = function draw(gd) {
165167
// move up the page
166168
ya._length * (1 - d.y) + ya._offset :
167169
ya.r2p(d.y) + ya._offset;
170+
} else if (d.yref == "container") {
171+
yPos = (1 - d.y) * fullLayout.height;
168172
} else {
169173
yPos = size.h - d.y * size.h + size.t;
170174
}
171175
yPos += yOffset;
172176

177+
console.log(d)
178+
173179
// Construct the proper aspectRatio attribute
174180
switch(d.sizing) {
175181
case 'fill':

test/image/mocks/epoch_mock.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)
0