New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@nightingale-elements/nightingale-linegraph-track

Package Overview
Dependencies
Maintainers
4
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@nightingale-elements/nightingale-linegraph-track - npm Package Compare versions

Comparing version 4.0.3-alpha.0 to 4.0.3

dist/assets/asset-01ba4719

9

dist/nightingale-linegraph-track.d.ts

@@ -6,10 +6,10 @@ import { ScaleLinear, CurveFactory, Area, Line } from "d3";

};
declare type LineValue = {
type LineValue = {
position: number;
value: number;
};
declare type LineData = {
type LineData = {
name: string;
range: number[];
colour?: string;
color?: string;
fill?: string;

@@ -19,3 +19,3 @@ lineCurve?: keyof typeof curves;

};
declare const NightingaleLinegraphTrack_base: import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withZoom").WithZoomInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withMargin").withMarginInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withPosition").withPositionInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withDimensions").WithDimensionsInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withHighlight").WithHighlightInterface> & typeof NightingaleElement;
declare const NightingaleLinegraphTrack_base: import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withZoom").WithZoomInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withResizable").WithResizableInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withMargin").withMarginInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withPosition").withPositionInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withDimensions").WithDimensionsInterface> & import("@nightingale-elements/nightingale-new-core/dist/nightingale-base-element").Constructor<import("@nightingale-elements/nightingale-new-core/dist/mixins/withHighlight").WithHighlightInterface> & typeof NightingaleElement;
declare class NightingaleLinegraphTrack extends NightingaleLinegraphTrack_base {

@@ -31,2 +31,3 @@ #private;

refresh(): void;
onDimensionsChange(): void;
_initYScale(): void;

@@ -33,0 +34,0 @@ drawLine(d: LineData): Area<LineValue> | Line<LineValue>;

{
"name": "@nightingale-elements/nightingale-linegraph-track",
"description": "Nightingale Line Graph",
"version": "4.0.3-alpha.0",
"version": "4.0.3",
"files": [

@@ -35,6 +35,6 @@ "dist",

"dependencies": {
"@nightingale-elements/nightingale-new-core": "*",
"d3": "7.6.1"
"@nightingale-elements/nightingale-new-core": "^4.0.3",
"d3": "7.8.3"
},
"gitHead": "5fa55c1b97504b8510c23b8a0d3b393259d31cff"
"gitHead": "a9dbc45f4a6940e915a6eac46e5bd8691281d802"
}

@@ -41,5 +41,5 @@ # nightingale-linegraph-track

range:[min, max],
colour?: Line colour,
(Colour will be assigned if not provided. Use "none" for no line colour)
fill?: Create area plot using given fill colour (default "none"),
color?: Line color,
(color will be assigned if not provided. Use "none" for no line color)
fill?: Create area plot using given fill color (default "none"),
lineCurve?: 'curveLinear'(default)|'curveBasis'|'curveCardinal'|'curveStep'|'curveNatural',

@@ -46,0 +46,0 @@ (More curves - https://github.com/d3/d3-shape/blob/v2.0.0/README.md#curves)

@@ -59,4 +59,4 @@ import { customElement, property } from "lit/decorators.js";

range: number[];
colour?: string; // (Colour will be assigned if not provided. Use "none" for no line colour)
fill?: string; //Create area plot using given fill colour (default "none"),
color?: string; // (color will be assigned if not provided. Use "none" for no line color)
fill?: string; //Create area plot using given fill color (default "none"),
lineCurve?: keyof typeof curves; // See https://github.com/d3/d3-shape/#curves

@@ -101,2 +101,8 @@ values: Array<LineValue>;

#maxRange?: number;
#overlay?: Selection<
SVGRectElement,
unknown,
HTMLElement | SVGElement | null,
unknown
>;

@@ -169,3 +175,3 @@ constructor() {

.attr("d", (d) => {
d.colour = d.colour || interpolateRainbow(Math.random());
d.color = d.color || interpolateRainbow(Math.random());
// eslint-disable-next-line no-param-reassign

@@ -176,3 +182,3 @@ d.fill = d.fill || "none";

.attr("fill", (d) => d.fill || null)
.attr("stroke", (d) => d.colour || null)
.attr("stroke", (d) => d.color || null)
.attr("transform", "translate(0,0)");

@@ -194,3 +200,3 @@

.attr("r", 7)
.style("stroke", (d) => d.colour || null)
.style("stroke", (d) => d.color || null)
.style("fill", "none")

@@ -200,5 +206,8 @@ .style("stroke-width", "1px")

mousePerLine.append("text").attr("transform", "translate(10,3)");
mousePerLine
.append("text")
.attr("transform", "translate(10,3)")
.attr("pointer-events", "none");
mouseG
this.#overlay = mouseG
.append("rect") // append a rect to catch mouse movements on canvas

@@ -220,4 +229,7 @@ .attr("width", this.width) // can't catch mouse events on a g element

if (
mouse[0] < (this.xScale?.(beginning) || 0) ||
mouse[0] > (this.xScale?.(end) || 0) + this.getSingleBaseWidth()
mouse[0] < (this.xScale?.(beginning) || 0) + this["margin-left"] ||
mouse[0] >
(this.xScale?.(end) || 0) +
this.getSingleBaseWidth() +
this["margin-left"]
) {

@@ -228,3 +240,5 @@ chartGroup.selectAll(".mouse-per-line circle").style("opacity", "0");

const features: Record<string, LineValue | undefined> = {};
const seqPosition = Math.floor(this.xScale?.invert(mouse[0]) || 0);
const seqPosition = Math.floor(
this.xScale?.invert(mouse[0] - this["margin-left"]) || 0
);

@@ -302,6 +316,3 @@ chartGroup

this.svg = select(this as unknown as NightingaleElement)
.selectAll<SVGSVGElement, unknown>("svg")
.attr("width", this.width)
.attr("height", this.height);
this.svg?.attr("width", this.width);

@@ -313,2 +324,6 @@ this.updateHighlight();

}
onDimensionsChange(): void {
super.onDimensionsChange();
this.#overlay?.attr("width", this.width).attr("height", this.height);
}

@@ -335,7 +350,11 @@ _initYScale() {

.defined((d) => d.value !== null) // To have gaps in the line graph
.x(
(d) =>
this.getXFromSeqPosition(d.position + 1) -
this.getSingleBaseWidth() / 2
)
.x((d, i, data) => {
let offset = this.getSingleBaseWidth() / 2;
if (i === 0 || data[i - 1]?.value === null) {
offset = this.getSingleBaseWidth();
} else if (i + 1 === data.length || data[i + 1]?.value === null) {
offset = 0;
}
return this.getXFromSeqPosition(d.position + 1) - offset;
})
.curve(curves[curve] || curveLinear);

@@ -342,0 +361,0 @@ }

Sorry, the diff of this file is too big to display

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