@sigma/edge-curve
Advanced tools
Comparing version 3.0.0-beta.11 to 3.0.0-beta.12
import { Attributes } from "graphology-types"; | ||
import { EdgeProgramType } from "sigma/rendering"; | ||
import { CreateEdgeCurveProgramOptions } from "./utils.js"; | ||
export default function createEdgeCurveProgram<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes>(inputOptions?: Partial<CreateEdgeCurveProgramOptions>): EdgeProgramType<N, E, G>; | ||
export default function createEdgeCurveProgram<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes>(inputOptions?: Partial<CreateEdgeCurveProgramOptions<N, E, G>>): EdgeProgramType<N, E, G>; |
import { EdgeProgramType } from "sigma/rendering"; | ||
export { default as createEdgeCurveProgram } from "./factory.js"; | ||
export { indexParallelEdgesIndex, DEFAULT_EDGE_CURVATURE } from "./utils.js"; | ||
export { createDrawCurvedEdgeLabel } from "./edge-labels.js"; | ||
declare const EdgeCurveProgram: EdgeProgramType; | ||
export default EdgeCurveProgram; | ||
export declare const EdgeCurvedArrowProgram: EdgeProgramType; |
import Graph from "graphology"; | ||
import { Attributes } from "graphology-types"; | ||
import { EdgeLabelDrawingFunction } from "sigma/rendering"; | ||
export declare const DEFAULT_EDGE_CURVATURE = 0.25; | ||
export type CreateEdgeCurveProgramOptions = { | ||
export type CreateEdgeCurveProgramOptions<N extends Attributes = Attributes, E extends Attributes = Attributes, G extends Attributes = Attributes> = { | ||
curvatureAttribute: string; | ||
@@ -10,2 +12,3 @@ defaultCurvature: number; | ||
}; | ||
drawLabel?: EdgeLabelDrawingFunction<N, E, G> | undefined; | ||
}; | ||
@@ -12,0 +15,0 @@ export declare const DEFAULT_EDGE_CURVE_PROGRAM_OPTIONS: CreateEdgeCurveProgramOptions; |
@@ -196,3 +196,3 @@ 'use strict'; | ||
} | ||
function getDrawCurvedEdgeLabel(_ref) { | ||
function createDrawCurvedEdgeLabel(_ref) { | ||
var curvatureAttribute = _ref.curvatureAttribute, | ||
@@ -413,4 +413,6 @@ defaultCurvature = _ref.defaultCurvature; | ||
var options = _objectSpread2(_objectSpread2({}, DEFAULT_EDGE_CURVE_PROGRAM_OPTIONS), inputOptions || {}); | ||
var arrowHead = options.arrowHead, | ||
curvatureAttribute = options.curvatureAttribute; | ||
var _ref = options, | ||
arrowHead = _ref.arrowHead, | ||
curvatureAttribute = _ref.curvatureAttribute, | ||
drawLabel = _ref.drawLabel; | ||
var UNIFORMS = ["u_matrix", "u_sizeRatio", "u_dimensions", "u_pixelRatio", "u_feather", "u_minEdgeThickness"].concat(_toConsumableArray(arrowHead ? ["u_lengthToThicknessRatio", "u_widenessToThicknessRatio"] : [])); | ||
@@ -426,3 +428,3 @@ return /*#__PURE__*/function (_EdgeProgram) { | ||
_this = _callSuper(this, EdgeCurveProgram, [].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", getDrawCurvedEdgeLabel(options)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", drawLabel || createDrawCurvedEdgeLabel(options)); | ||
return _this; | ||
@@ -511,5 +513,5 @@ } | ||
key: "setUniforms", | ||
value: function setUniforms(params, _ref) { | ||
var gl = _ref.gl, | ||
uniformLocations = _ref.uniformLocations; | ||
value: function setUniforms(params, _ref2) { | ||
var gl = _ref2.gl, | ||
uniformLocations = _ref2.uniformLocations; | ||
var u_matrix = uniformLocations.u_matrix, | ||
@@ -546,4 +548,5 @@ u_pixelRatio = uniformLocations.u_pixelRatio, | ||
exports.EdgeCurvedArrowProgram = EdgeCurvedArrowProgram; | ||
exports.createDrawCurvedEdgeLabel = createDrawCurvedEdgeLabel; | ||
exports.createEdgeCurveProgram = createEdgeCurveProgram; | ||
exports["default"] = EdgeCurveProgram; | ||
exports.indexParallelEdgesIndex = indexParallelEdgesIndex; |
@@ -196,3 +196,3 @@ 'use strict'; | ||
} | ||
function getDrawCurvedEdgeLabel(_ref) { | ||
function createDrawCurvedEdgeLabel(_ref) { | ||
var curvatureAttribute = _ref.curvatureAttribute, | ||
@@ -413,4 +413,6 @@ defaultCurvature = _ref.defaultCurvature; | ||
var options = _objectSpread2(_objectSpread2({}, DEFAULT_EDGE_CURVE_PROGRAM_OPTIONS), inputOptions || {}); | ||
var arrowHead = options.arrowHead, | ||
curvatureAttribute = options.curvatureAttribute; | ||
var _ref = options, | ||
arrowHead = _ref.arrowHead, | ||
curvatureAttribute = _ref.curvatureAttribute, | ||
drawLabel = _ref.drawLabel; | ||
var UNIFORMS = ["u_matrix", "u_sizeRatio", "u_dimensions", "u_pixelRatio", "u_feather", "u_minEdgeThickness"].concat(_toConsumableArray(arrowHead ? ["u_lengthToThicknessRatio", "u_widenessToThicknessRatio"] : [])); | ||
@@ -426,3 +428,3 @@ return /*#__PURE__*/function (_EdgeProgram) { | ||
_this = _callSuper(this, EdgeCurveProgram, [].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", getDrawCurvedEdgeLabel(options)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", drawLabel || createDrawCurvedEdgeLabel(options)); | ||
return _this; | ||
@@ -511,5 +513,5 @@ } | ||
key: "setUniforms", | ||
value: function setUniforms(params, _ref) { | ||
var gl = _ref.gl, | ||
uniformLocations = _ref.uniformLocations; | ||
value: function setUniforms(params, _ref2) { | ||
var gl = _ref2.gl, | ||
uniformLocations = _ref2.uniformLocations; | ||
var u_matrix = uniformLocations.u_matrix, | ||
@@ -546,4 +548,5 @@ u_pixelRatio = uniformLocations.u_pixelRatio, | ||
exports.EdgeCurvedArrowProgram = EdgeCurvedArrowProgram; | ||
exports.createDrawCurvedEdgeLabel = createDrawCurvedEdgeLabel; | ||
exports.createEdgeCurveProgram = createEdgeCurveProgram; | ||
exports["default"] = EdgeCurveProgram; | ||
exports.indexParallelEdgesIndex = indexParallelEdgesIndex; |
@@ -192,3 +192,3 @@ import { EdgeProgram, DEFAULT_EDGE_ARROW_HEAD_PROGRAM_OPTIONS } from 'sigma/rendering'; | ||
} | ||
function getDrawCurvedEdgeLabel(_ref) { | ||
function createDrawCurvedEdgeLabel(_ref) { | ||
var curvatureAttribute = _ref.curvatureAttribute, | ||
@@ -409,4 +409,6 @@ defaultCurvature = _ref.defaultCurvature; | ||
var options = _objectSpread2(_objectSpread2({}, DEFAULT_EDGE_CURVE_PROGRAM_OPTIONS), inputOptions || {}); | ||
var arrowHead = options.arrowHead, | ||
curvatureAttribute = options.curvatureAttribute; | ||
var _ref = options, | ||
arrowHead = _ref.arrowHead, | ||
curvatureAttribute = _ref.curvatureAttribute, | ||
drawLabel = _ref.drawLabel; | ||
var UNIFORMS = ["u_matrix", "u_sizeRatio", "u_dimensions", "u_pixelRatio", "u_feather", "u_minEdgeThickness"].concat(_toConsumableArray(arrowHead ? ["u_lengthToThicknessRatio", "u_widenessToThicknessRatio"] : [])); | ||
@@ -422,3 +424,3 @@ return /*#__PURE__*/function (_EdgeProgram) { | ||
_this = _callSuper(this, EdgeCurveProgram, [].concat(args)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", getDrawCurvedEdgeLabel(options)); | ||
_defineProperty(_assertThisInitialized(_this), "drawLabel", drawLabel || createDrawCurvedEdgeLabel(options)); | ||
return _this; | ||
@@ -507,5 +509,5 @@ } | ||
key: "setUniforms", | ||
value: function setUniforms(params, _ref) { | ||
var gl = _ref.gl, | ||
uniformLocations = _ref.uniformLocations; | ||
value: function setUniforms(params, _ref2) { | ||
var gl = _ref2.gl, | ||
uniformLocations = _ref2.uniformLocations; | ||
var u_matrix = uniformLocations.u_matrix, | ||
@@ -540,2 +542,2 @@ u_pixelRatio = uniformLocations.u_pixelRatio, | ||
export { DEFAULT_EDGE_CURVATURE, EdgeCurvedArrowProgram, createEdgeCurveProgram, EdgeCurveProgram as default, indexParallelEdgesIndex }; | ||
export { DEFAULT_EDGE_CURVATURE, EdgeCurvedArrowProgram, createDrawCurvedEdgeLabel, createEdgeCurveProgram, EdgeCurveProgram as default, indexParallelEdgesIndex }; |
{ | ||
"name": "@sigma/edge-curve", | ||
"version": "3.0.0-beta.11", | ||
"version": "3.0.0-beta.12", | ||
"description": "An edge program that renders edges as curves for sigma.js", | ||
@@ -50,3 +50,3 @@ "main": "dist/sigma-edge-curve.cjs.js", | ||
}, | ||
"gitHead": "c15a1ad161776b939a3efe55e71d7ba8f12d26b1" | ||
"gitHead": "276697d2e189cd766f01205ad7599493d39237b7" | ||
} |
Sorry, the diff of this file is not supported yet
80902
16
1608