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

react-d3-core

Package Overview
Dependencies
Maintainers
1
Versions
81
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-d3-core - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

6

lib/legend.js

@@ -68,3 +68,3 @@ "use strict";

var bgRect = legend.append("rect").attr("x", -20).attr("y", -4).attr("width", 220).attr("height", 20).style("fill", "#EEE").style("fill-opacity", 0.3);
var bgRect = legend.append("rect").attr("y", -4).attr("width", 220).attr("height", 20).style("fill", "#EEE").style("fill-opacity", 0.3);

@@ -76,3 +76,3 @@ var rect = legend.append("rect").attr("width", 18).attr("height", 18).style("fill", function (d) {

var text = legend.append("text").attr("y", 9).attr("dy", ".35em").text(function (d) {
return d.name.substring(0, 20);
if (d.name.length > 20) return d.name.substring(0, 20) + '...';else return d.name;
});

@@ -86,2 +86,3 @@

text.attr("x", -24).style("text-anchor", "end");
bgRect.attr("x", -200);
} else if (legendPosition === 'left') {

@@ -93,2 +94,3 @@ legend.attr("transform", function (d, i) {

text.attr("x", 24).style("text-anchor", "start");
bgRect.attr("x", -20);
}

@@ -95,0 +97,0 @@ }

{
"name": "react-d3-core",
"version": "0.2.2",
"version": "0.2.3",
"description": "react-d3 chart core component",

@@ -5,0 +5,0 @@ "main": "./lib/index.js",

@@ -77,3 +77,2 @@ "use strict";

var bgRect = legend.append("rect")
.attr("x", -20)
.attr("y", -4)

@@ -93,3 +92,8 @@ .attr("width", 220)

.attr("dy", ".35em")
.text((d) => { return d.name.substring(0, 20); });
.text((d) => {
if(d.name.length > 20)
return `${d.name.substring(0, 20)}...`;
else
return d.name;
});

@@ -101,2 +105,3 @@ if(legendPosition === 'right') {

.style("text-anchor", "end")
bgRect.attr("x", -200)
}else if(legendPosition === 'left') {

@@ -107,2 +112,3 @@ legend.attr("transform", (d, i) => { return `translate(${margins.left + legendOffset}, ${margins.top + i * 20})`; });

.style("text-anchor", "start")
bgRect.attr("x", -20)
}

@@ -109,0 +115,0 @@ }

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