Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-solidgauge

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-solidgauge - npm Package Compare versions

Comparing version 1.0.14 to 1.0.15

2

examples/index.jsx

@@ -48,6 +48,6 @@ import React, { Component } from 'react';

}}
onClick={this.onClick}
>
<SolidGauge
responsive
selectable
pathWidth={0.10}

@@ -54,0 +54,0 @@ pathMargin={0.05}

{
"name": "react-solidgauge",
"version": "1.0.14",
"version": "1.0.15",
"description": "A Small React-D3 solid gauge chart inspired by amcharts",

@@ -62,4 +62,4 @@ "main": "dist/index.js",

"react-dom": "^15.4.1",
"react-offcharts-core": "^0.1.2"
"react-offcharts-core": "^0.1.6"
}
}

@@ -16,2 +16,4 @@ import React, { Component, PropTypes } from 'react';

endAngle: PropTypes.number,
selectable: PropTypes.bool,
onSelect: PropTypes.func,
}

@@ -21,2 +23,5 @@

this.appendHover();
if (this.props.selectable) {
this.appendSelect();
}
}

@@ -27,2 +32,12 @@

}
appendSelect() {
const el = select(this.container);
el
.selectAll(`path.${ch.MOUSE_PATH}`)
.on('click', (d, i, p) => {
console.log(p[i]);
});
}
appendHover() {

@@ -43,2 +58,9 @@ const el = select(this.container);

const mouseText = tool.select('text');
mouseText
.select('tspan.label')
.text(label);
mouseText
.select('tspan.value')
.text(`${Math.floor(value)}%`);
const textLength = dh.getTextLength(mouseText.node());

@@ -63,9 +85,3 @@ mw = textLength;

mouseText
.select('tspan.label')
.text(label);
mouseText
.select('tspan.value')
.text(`${Math.floor(value)}%`);
tool

@@ -72,0 +88,0 @@ .select('path')

@@ -101,10 +101,16 @@ import React, { Component, PropTypes } from 'react';

}
endCircle.attr('opacity', '1');
return (t) => {
thisArc.endAngle((inter(t)));
const newArc = dh.doubleArc(thisArc);
endC.attr('transform', `translate(${newArc.centroid()})`);
return thisArc();
};
})
.on('end', (d, i) => {
if (this.props.selectable && i === this.props.values.length - 1) {
this.appendSelectOnPaths();
}
});

@@ -111,0 +117,0 @@ }

@@ -44,2 +44,3 @@ import React, { PropTypes } from 'react';

mouseStrokeWidth={props.mouseStrokeWidth}
selectable={props.selectable}
/>

@@ -81,2 +82,3 @@ </ReactIf>

mouseStrokeWidth: PropTypes.number,
selectable: PropTypes.bool,
shadow: PropTypes.shape({

@@ -83,0 +85,0 @@ id: PropTypes.string,

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc