@sigma/node-border
Advanced tools
Comparing version 3.0.0-beta.4 to 3.0.0-beta.5
import { Attributes } from "graphology-types"; | ||
import { NodeProgramType } from "sigma/rendering"; | ||
import { CreateNodeBorderProgramOptions } from "./utils.js"; | ||
export default function getNodeBorderProgram<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes>(inputOptions?: Partial<CreateNodeBorderProgramOptions>): NodeProgramType<N, E, G>; | ||
export default function createNodeBorderProgram<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes>(inputOptions?: Partial<CreateNodeBorderProgramOptions<N, E, G>>): NodeProgramType<N, E, G>; |
@@ -0,1 +1,3 @@ | ||
import { Attributes } from "graphology-types"; | ||
import { NodeHoverDrawingFunction, NodeLabelDrawingFunction } from "sigma/rendering"; | ||
export type NodeBorderSizeMode = "relative" | "pixels"; | ||
@@ -21,3 +23,3 @@ export declare const DEFAULT_BORDER_SIZE_MODE: NodeBorderSizeMode; | ||
}; | ||
export interface CreateNodeBorderProgramOptions { | ||
export interface CreateNodeBorderProgramOptions<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes> { | ||
borders: { | ||
@@ -27,4 +29,6 @@ color: NodeBorderColor; | ||
}[]; | ||
drawLabel: NodeLabelDrawingFunction<N, E, G> | undefined; | ||
drawHover: NodeHoverDrawingFunction<N, E, G> | undefined; | ||
} | ||
export declare const DEFAULT_CREATE_NODE_BORDER_OPTIONS: CreateNodeBorderProgramOptions; | ||
export declare const DEFAULT_CREATE_NODE_BORDER_OPTIONS: CreateNodeBorderProgramOptions<Attributes, Attributes, Attributes>; | ||
export declare const DEFAULT_COLOR = "#000000"; |
@@ -219,2 +219,4 @@ 'use strict'; | ||
var DEFAULT_CREATE_NODE_BORDER_OPTIONS = { | ||
drawLabel: undefined, | ||
drawHover: undefined, | ||
borders: [{ | ||
@@ -308,6 +310,8 @@ size: { | ||
FLOAT = _WebGLRenderingContex.FLOAT; | ||
function getNodeBorderProgram(inputOptions) { | ||
function createNodeBorderProgram(inputOptions) { | ||
var _NodeBorderProgram; | ||
var options = _objectSpread2(_objectSpread2({}, DEFAULT_CREATE_NODE_BORDER_OPTIONS), inputOptions || {}); | ||
var borders = options.borders; | ||
var borders = options.borders, | ||
drawLabel = options.drawLabel, | ||
drawHover = options.drawHover; | ||
var UNIFORMS = ["u_sizeRatio", "u_correctionRatio", "u_matrix"].concat(_toConsumableArray(borders.flatMap(function (_ref, i) { | ||
@@ -320,4 +324,11 @@ var color = _ref.color; | ||
function NodeBorderProgram() { | ||
var _this; | ||
_classCallCheck(this, NodeBorderProgram); | ||
return _callSuper(this, NodeBorderProgram, arguments); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _callSuper(this, NodeBorderProgram, [].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", drawLabel); | ||
_defineProperty(_assertThisInitialized(_this), "drawHover", drawHover); | ||
return _this; | ||
} | ||
@@ -417,5 +428,5 @@ _createClass(NodeBorderProgram, [{ | ||
var NodeBorderProgram = getNodeBorderProgram(); | ||
var NodeBorderProgram = createNodeBorderProgram(); | ||
exports.NodeBorderProgram = NodeBorderProgram; | ||
exports.createNodeBorderProgram = getNodeBorderProgram; | ||
exports.createNodeBorderProgram = createNodeBorderProgram; |
@@ -219,2 +219,4 @@ 'use strict'; | ||
var DEFAULT_CREATE_NODE_BORDER_OPTIONS = { | ||
drawLabel: undefined, | ||
drawHover: undefined, | ||
borders: [{ | ||
@@ -308,6 +310,8 @@ size: { | ||
FLOAT = _WebGLRenderingContex.FLOAT; | ||
function getNodeBorderProgram(inputOptions) { | ||
function createNodeBorderProgram(inputOptions) { | ||
var _NodeBorderProgram; | ||
var options = _objectSpread2(_objectSpread2({}, DEFAULT_CREATE_NODE_BORDER_OPTIONS), inputOptions || {}); | ||
var borders = options.borders; | ||
var borders = options.borders, | ||
drawLabel = options.drawLabel, | ||
drawHover = options.drawHover; | ||
var UNIFORMS = ["u_sizeRatio", "u_correctionRatio", "u_matrix"].concat(_toConsumableArray(borders.flatMap(function (_ref, i) { | ||
@@ -320,4 +324,11 @@ var color = _ref.color; | ||
function NodeBorderProgram() { | ||
var _this; | ||
_classCallCheck(this, NodeBorderProgram); | ||
return _callSuper(this, NodeBorderProgram, arguments); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _callSuper(this, NodeBorderProgram, [].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", drawLabel); | ||
_defineProperty(_assertThisInitialized(_this), "drawHover", drawHover); | ||
return _this; | ||
} | ||
@@ -417,5 +428,5 @@ _createClass(NodeBorderProgram, [{ | ||
var NodeBorderProgram = getNodeBorderProgram(); | ||
var NodeBorderProgram = createNodeBorderProgram(); | ||
exports.NodeBorderProgram = NodeBorderProgram; | ||
exports.createNodeBorderProgram = getNodeBorderProgram; | ||
exports.createNodeBorderProgram = createNodeBorderProgram; |
@@ -215,2 +215,4 @@ import { numberToGLSLFloat, NodeProgram } from 'sigma/rendering'; | ||
var DEFAULT_CREATE_NODE_BORDER_OPTIONS = { | ||
drawLabel: undefined, | ||
drawHover: undefined, | ||
borders: [{ | ||
@@ -304,6 +306,8 @@ size: { | ||
FLOAT = _WebGLRenderingContex.FLOAT; | ||
function getNodeBorderProgram(inputOptions) { | ||
function createNodeBorderProgram(inputOptions) { | ||
var _NodeBorderProgram; | ||
var options = _objectSpread2(_objectSpread2({}, DEFAULT_CREATE_NODE_BORDER_OPTIONS), inputOptions || {}); | ||
var borders = options.borders; | ||
var borders = options.borders, | ||
drawLabel = options.drawLabel, | ||
drawHover = options.drawHover; | ||
var UNIFORMS = ["u_sizeRatio", "u_correctionRatio", "u_matrix"].concat(_toConsumableArray(borders.flatMap(function (_ref, i) { | ||
@@ -316,4 +320,11 @@ var color = _ref.color; | ||
function NodeBorderProgram() { | ||
var _this; | ||
_classCallCheck(this, NodeBorderProgram); | ||
return _callSuper(this, NodeBorderProgram, arguments); | ||
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) { | ||
args[_key] = arguments[_key]; | ||
} | ||
_this = _callSuper(this, NodeBorderProgram, [].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", drawLabel); | ||
_defineProperty(_assertThisInitialized(_this), "drawHover", drawHover); | ||
return _this; | ||
} | ||
@@ -413,4 +424,4 @@ _createClass(NodeBorderProgram, [{ | ||
var NodeBorderProgram = getNodeBorderProgram(); | ||
var NodeBorderProgram = createNodeBorderProgram(); | ||
export { NodeBorderProgram, getNodeBorderProgram as createNodeBorderProgram }; | ||
export { NodeBorderProgram, createNodeBorderProgram }; |
@@ -1,2 +0,2 @@ | ||
Copyright (C) 2013-2024, Alexis Jacomy, Guillaume Plique https://www.sigmajs.org | ||
Copyright (C) 2013-2024, Alexis Jacomy, Guillaume Plique, Benoît Simard https://www.sigmajs.org | ||
@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), |
{ | ||
"name": "@sigma/node-border", | ||
"version": "3.0.0-beta.4", | ||
"version": "3.0.0-beta.5", | ||
"description": "A node program that renders concentric discs in nodes for sigma.js", | ||
@@ -46,3 +46,3 @@ "main": "dist/sigma-node-border.cjs.js", | ||
}, | ||
"gitHead": "9fa5a2fd0c27ebe380f7d3c9f3941e8789c4187c" | ||
"gitHead": "9e1b79398170ecdfea5531ed1443f22f486bbb2a" | ||
} |
59875
1248