d3-vx-helper
Advanced tools
Comparing version 1.0.7 to 1.0.8
@@ -5,4 +5,4 @@ { | ||
"index.html": "/callmedadaxin/d3-helper/index.html", | ||
"precache-manifest.6a3094e9728c8be0a7a5f7f6e9b11950.js": "/callmedadaxin/d3-helper/precache-manifest.6a3094e9728c8be0a7a5f7f6e9b11950.js", | ||
"precache-manifest.9b65f9bcc9b8f94fcd1741ce429b0a28.js": "/callmedadaxin/d3-helper/precache-manifest.9b65f9bcc9b8f94fcd1741ce429b0a28.js", | ||
"service-worker.js": "/callmedadaxin/d3-helper/service-worker.js" | ||
} |
@@ -17,3 +17,3 @@ /** | ||
importScripts( | ||
"/callmedadaxin/d3-helper/precache-manifest.6a3094e9728c8be0a7a5f7f6e9b11950.js" | ||
"/callmedadaxin/d3-helper/precache-manifest.9b65f9bcc9b8f94fcd1741ce429b0a28.js" | ||
); | ||
@@ -20,0 +20,0 @@ |
{ | ||
"name": "d3-vx-helper", | ||
"version": "1.0.7", | ||
"version": "1.0.8", | ||
"description": "d3 and vx helper for our team", | ||
@@ -5,0 +5,0 @@ "main": "build/static/js/main.js", |
@@ -14,2 +14,3 @@ import React, { Component } from 'react'; | ||
const y = d => +d.close; | ||
const y2 = d => +d.close - 10; | ||
console.log(appleStock) | ||
@@ -42,6 +43,5 @@ | ||
const stackScale = scaleLinear({ | ||
rangeRound: [height, 0], | ||
domain: [0, d3.max(data, d => y(d) * 2)] | ||
range: [height, 0], | ||
domain: [0, d3.max(data, d => y(d) + y(d))] | ||
}) | ||
return <Group> | ||
@@ -48,0 +48,0 @@ <Grid width={width} tickValues={[100, 105]} height={height} xScale={xScale} yScale={yScale}/> |
@@ -72,2 +72,5 @@ import React, { PureComponent, Fragment } from 'react' | ||
const size = this.getContainerSize() | ||
const center = size.width / 2 | ||
const left = tooltipLeft + 10 + padding.left | ||
const right = size.width - tooltipLeft + 10 + padding.right | ||
return ( | ||
@@ -89,4 +92,4 @@ <div> | ||
? <Line | ||
from={{ x: tooltipLeft - 1, y: 0 }} | ||
to={{ x: tooltipLeft - 1, y: height }} | ||
from={{ x: tooltipLeft - 1, y: padding.top }} | ||
to={{ x: tooltipLeft - 1, y: padding.top + size.height }} | ||
/> | ||
@@ -101,3 +104,4 @@ : '' | ||
top={tooltipTop} | ||
left={tooltipLeft + 10 + padding.left} | ||
left={left < center ? left : 'auto'} | ||
right={left < center ? 'auto' : right} | ||
> | ||
@@ -104,0 +108,0 @@ <Fragment> |
@@ -12,3 +12,3 @@ import React from 'react'; | ||
export default function Tooltip({ className, top, left, style, children, ...restProps }) { | ||
export default function Tooltip({ className, top, left, right, style, children, ...restProps }) { | ||
return ( | ||
@@ -31,2 +31,3 @@ <div | ||
left, | ||
right, | ||
...style | ||
@@ -33,0 +34,0 @@ }} |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
768378
2846