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

rollup-plugin-visualizer

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-visualizer - npm Package Compare versions

Comparing version 2.1.1 to 2.2.0

86

lib/main-circlepacking.js

@@ -685,2 +685,4 @@ (function () {

var event = null;
if (typeof document !== "undefined") {

@@ -705,5 +707,8 @@ var element = document.documentElement;

return function(event1) {
var event0 = event; // Events can be reentrant (e.g., focus).
event = event1;
try {
listener.call(this, this.__data__, index, group);
} finally {
event = event0;
}

@@ -862,2 +867,28 @@ };

function sourceEvent() {
var current = event, source;
while (source = current.sourceEvent) current = source;
return current;
}
function point(node, event) {
var svg = node.ownerSVGElement || node;
if (svg.createSVGPoint) {
var point = svg.createSVGPoint();
point.x = event.clientX, point.y = event.clientY;
point = point.matrixTransform(node.getScreenCTM().inverse());
return [point.x, point.y];
}
var rect = node.getBoundingClientRect();
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
}
function d3mouse(node) {
var event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
}
var prefix = "$";

@@ -1713,2 +1744,37 @@

//https://www.d3-graph-gallery.com/graph/interactivity_tooltip.html#template
const createTooltip = node =>
node
.append("div")
.style("opacity", 0)
.attr("class", "tooltip")
.style("background-color", "white")
.style("border", "solid")
.style("border-width", "2px")
.style("border-radius", "5px")
.style("padding", "5px");
const createMouseover = (tooltipNode, container) => d => tooltipNode.style("opacity", 1);
const createMousemove = (tooltipNode, container, totalSize) => d => {
const [x, y] = d3mouse(container);
const nodePath = d
.ancestors()
.reverse()
.map(d => d.data.name)
.join("/");
const percentageNum = (100 * d.value) / totalSize;
const percentage = percentageNum.toFixed(2);
const percentageString = percentage + "%";
tooltipNode
.html(`${nodePath}<br/><b>${format_1(d.value)}</b><br/>${percentageString}`)
.style("left", x + 30 + "px")
.style("top", y + "px");
};
const createMouseleave = (tooltipNode, container) => d => tooltipNode.style("opacity", 0);
const WIDTH = 1000;

@@ -1719,4 +1785,2 @@ const HEIGHT = 1000;

const format$1 = format_1;
for (const { id, root: data } of window.nodesData) {

@@ -1742,2 +1806,4 @@ const wrapper = document.createElement("div");

const totalSize = root.value;
const layout = d3pack()

@@ -1747,2 +1813,4 @@ .size([WIDTH - 2, HEIGHT - 2])

const tooltip = createTooltip(select(chartNode));
layout(root);

@@ -1777,3 +1845,6 @@

.join("g")
.attr("transform", d => `translate(${d.x + 1},${d.y + 1})`);
.attr("transform", d => `translate(${d.x + 1},${d.y + 1})`)
.on("mouseover", createMouseover(tooltip))
.on("mousemove", createMousemove(tooltip, chartNode, totalSize))
.on("mouseleave", createMouseleave(tooltip));

@@ -1804,13 +1875,4 @@ node

.text(d => d);
node.append("title").text(
d =>
`${d
.ancestors()
.map(d => d.data.name)
.reverse()
.join("/")}\n${format$1(d.value)}`
);
}
}());

@@ -685,2 +685,4 @@ (function () {

var event = null;
if (typeof document !== "undefined") {

@@ -705,5 +707,8 @@ var element = document.documentElement;

return function(event1) {
var event0 = event; // Events can be reentrant (e.g., focus).
event = event1;
try {
listener.call(this, this.__data__, index, group);
} finally {
event = event0;
}

@@ -862,2 +867,28 @@ };

function sourceEvent() {
var current = event, source;
while (source = current.sourceEvent) current = source;
return current;
}
function point(node, event) {
var svg = node.ownerSVGElement || node;
if (svg.createSVGPoint) {
var point = svg.createSVGPoint();
point.x = event.clientX, point.y = event.clientY;
point = point.matrixTransform(node.getScreenCTM().inverse());
return [point.x, point.y];
}
var rect = node.getBoundingClientRect();
return [event.clientX - rect.left - node.clientLeft, event.clientY - rect.top - node.clientTop];
}
function d3mouse(node) {
var event = sourceEvent();
if (event.changedTouches) event = event.changedTouches[0];
return point(node, event);
}
var prefix = "$";

@@ -1574,2 +1605,37 @@

//https://www.d3-graph-gallery.com/graph/interactivity_tooltip.html#template
const createTooltip = node =>
node
.append("div")
.style("opacity", 0)
.attr("class", "tooltip")
.style("background-color", "white")
.style("border", "solid")
.style("border-width", "2px")
.style("border-radius", "5px")
.style("padding", "5px");
const createMouseover = (tooltipNode, container) => d => tooltipNode.style("opacity", 1);
const createMousemove = (tooltipNode, container, totalSize) => d => {
const [x, y] = d3mouse(container);
const nodePath = d
.ancestors()
.reverse()
.map(d => d.data.name)
.join("/");
const percentageNum = (100 * d.value) / totalSize;
const percentage = percentageNum.toFixed(2);
const percentageString = percentage + "%";
tooltipNode
.html(`${nodePath}<br/><b>${format_1(d.value)}</b><br/>${percentageString}`)
.style("left", x + 30 + "px")
.style("top", y + "px");
};
const createMouseleave = (tooltipNode, container) => d => tooltipNode.style("opacity", 0);
const WIDTH = 1000;

@@ -1599,2 +1665,4 @@ const HEIGHT = 700;

const tooltip = createTooltip(select(chartNode));
const root = hierarchy(data)

@@ -1610,2 +1678,4 @@ .sum(d => {

const totalSize = root.value;
treemapLayout(root);

@@ -1639,13 +1709,7 @@

.join("g")
.attr("transform", d => `translate(${d.x0},${d.y0})`);
.attr("transform", d => `translate(${d.x0},${d.y0})`)
.on("mouseover", createMouseover(tooltip))
.on("mousemove", createMousemove(tooltip, chartNode, totalSize))
.on("mouseleave", createMouseleave(tooltip));
node.append("title").text(
d =>
`${d
.ancestors()
.reverse()
.map(d => d.data.name)
.join("/")}\n${format$1(d.value)}`
);
node

@@ -1652,0 +1716,0 @@ .append("rect")

2

package.json
{
"name": "rollup-plugin-visualizer",
"version": "2.1.1",
"version": "2.2.0",
"main": "plugin.js",

@@ -5,0 +5,0 @@ "author": "Denis Bardadym <bardadymchik@gmail.com>",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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