@opentrace/components 0.1.1-pr.118.8 → 0.1.1-rc.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components.css +45 -0
- package/dist/opentrace-components.cjs +44 -16
- package/dist/opentrace-components.cjs.map +1 -1
- package/dist/opentrace-components.js +45 -17
- package/dist/opentrace-components.js.map +1 -1
- package/dist/src/graph/useGraphFilters.d.ts.map +1 -1
- package/dist/src/graph/useGraphVisuals.d.ts.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/panels/GraphBadge.d.ts +4 -0
- package/dist/src/panels/GraphBadge.d.ts.map +1 -0
- package/dist/src/panels/index.d.ts +2 -1
- package/dist/src/panels/index.d.ts.map +1 -1
- package/dist/src/panels/types.d.ts +10 -0
- package/dist/src/panels/types.d.ts.map +1 -1
- package/dist/{useHighlights-BHlafcBH.js → useHighlights-BdiW6zWg.js} +16 -13
- package/dist/{useHighlights-BHlafcBH.js.map → useHighlights-BdiW6zWg.js.map} +1 -1
- package/dist/{useHighlights-D6Jl6Woe.cjs → useHighlights-Xr_gYCcU.cjs} +16 -13
- package/dist/{useHighlights-D6Jl6Woe.cjs.map → useHighlights-Xr_gYCcU.cjs.map} +1 -1
- package/dist/utils.cjs +1 -1
- package/dist/utils.js +1 -1
- package/package.json +1 -1
package/dist/components.css
CHANGED
|
@@ -215,6 +215,51 @@
|
|
|
215
215
|
* limitations under the License.
|
|
216
216
|
*/
|
|
217
217
|
|
|
218
|
+
.graph-badge {
|
|
219
|
+
font-size: 0.75rem;
|
|
220
|
+
color: var(--muted-foreground);
|
|
221
|
+
background: color-mix(in oklch, var(--background) 85%, transparent);
|
|
222
|
+
backdrop-filter: blur(8px);
|
|
223
|
+
height: 36px;
|
|
224
|
+
display: inline-flex;
|
|
225
|
+
align-items: center;
|
|
226
|
+
gap: 5px;
|
|
227
|
+
padding: 0 14px;
|
|
228
|
+
border-radius: calc(var(--radius) + 2px);
|
|
229
|
+
border: 1px solid color-mix(in oklch, var(--border) 25%, transparent);
|
|
230
|
+
pointer-events: auto;
|
|
231
|
+
font-variant-numeric: tabular-nums;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
.graph-badge-rendered {
|
|
235
|
+
font-weight: 600;
|
|
236
|
+
color: var(--foreground);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
.graph-badge-total {
|
|
240
|
+
color: var(--muted-foreground);
|
|
241
|
+
font-weight: 400;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
.graph-badge-sep {
|
|
245
|
+
margin: 0 3px;
|
|
246
|
+
}
|
|
247
|
+
/*
|
|
248
|
+
* Copyright 2026 OpenTrace Contributors
|
|
249
|
+
*
|
|
250
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
251
|
+
* you may not use this file except in compliance with the License.
|
|
252
|
+
* You may obtain a copy of the License at
|
|
253
|
+
*
|
|
254
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
255
|
+
*
|
|
256
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
257
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
258
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
259
|
+
* See the License for the specific language governing permissions and
|
|
260
|
+
* limitations under the License.
|
|
261
|
+
*/
|
|
262
|
+
|
|
218
263
|
/* Legend */
|
|
219
264
|
.legend {
|
|
220
265
|
position: absolute;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const t = require("react");
|
|
5
|
-
const useHighlights = require("./useHighlights-
|
|
5
|
+
const useHighlights = require("./useHighlights-Xr_gYCcU.cjs");
|
|
6
6
|
var _documentCurrentScript = typeof document !== "undefined" ? document.currentScript : null;
|
|
7
7
|
function _toPrimitive$1(t2, r) {
|
|
8
8
|
if ("object" != typeof t2 || !t2) return t2;
|
|
@@ -5547,21 +5547,24 @@ function useGraphVisuals(graph, layoutReady, visualState, layoutConfig, _degreeM
|
|
|
5547
5547
|
return attrs;
|
|
5548
5548
|
});
|
|
5549
5549
|
const defaultEdgeSize = isLargeGraph ? EDGE_SIZE_DEFAULT_LINE : EDGE_SIZE_DEFAULT;
|
|
5550
|
-
graph.updateEachEdgeAttributes(
|
|
5551
|
-
|
|
5552
|
-
|
|
5553
|
-
|
|
5554
|
-
|
|
5555
|
-
|
|
5556
|
-
|
|
5557
|
-
|
|
5558
|
-
|
|
5559
|
-
|
|
5560
|
-
|
|
5561
|
-
|
|
5562
|
-
|
|
5563
|
-
|
|
5564
|
-
|
|
5550
|
+
graph.updateEachEdgeAttributes(
|
|
5551
|
+
(_id, attrs, source, target) => {
|
|
5552
|
+
const linkKey = `${source}-${target}`;
|
|
5553
|
+
const isHighlighted = highlightLinks.has(linkKey);
|
|
5554
|
+
const baseColor = getLinkColor(attrs.label);
|
|
5555
|
+
if (hasHighlight) {
|
|
5556
|
+
attrs.color = isHighlighted ? baseColor : dimColor(baseColor, EDGE_OPACITY_DIMMED);
|
|
5557
|
+
attrs.size = isHighlighted ? EDGE_SIZE_HIGHLIGHTED : EDGE_SIZE_DIMMED;
|
|
5558
|
+
attrs.zIndex = isHighlighted ? 1 : 0;
|
|
5559
|
+
} else {
|
|
5560
|
+
attrs.color = dimColor(baseColor, EDGE_OPACITY_DEFAULT);
|
|
5561
|
+
attrs.size = defaultEdgeSize;
|
|
5562
|
+
attrs.zIndex = 0;
|
|
5563
|
+
}
|
|
5564
|
+
return attrs;
|
|
5565
|
+
},
|
|
5566
|
+
{ attributes: ["zIndex"] }
|
|
5567
|
+
);
|
|
5565
5568
|
}, [graph, layoutReady, visualState, layoutConfig, isLargeGraph]);
|
|
5566
5569
|
}
|
|
5567
5570
|
function c(r, n2) {
|
|
@@ -7675,6 +7678,30 @@ function FilterPanel({
|
|
|
7675
7678
|
] })
|
|
7676
7679
|
] });
|
|
7677
7680
|
}
|
|
7681
|
+
function GraphBadge({
|
|
7682
|
+
nodeCount,
|
|
7683
|
+
edgeCount,
|
|
7684
|
+
totalNodes,
|
|
7685
|
+
totalEdges
|
|
7686
|
+
}) {
|
|
7687
|
+
return /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "graph-badge", children: [
|
|
7688
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "graph-badge-rendered", children: nodeCount }),
|
|
7689
|
+
totalNodes != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "graph-badge-total", children: [
|
|
7690
|
+
"(",
|
|
7691
|
+
totalNodes,
|
|
7692
|
+
")"
|
|
7693
|
+
] }),
|
|
7694
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "nodes" }),
|
|
7695
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "graph-badge-sep", children: "·" }),
|
|
7696
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "graph-badge-rendered", children: edgeCount }),
|
|
7697
|
+
totalEdges != null && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "graph-badge-total", children: [
|
|
7698
|
+
"(",
|
|
7699
|
+
totalEdges,
|
|
7700
|
+
")"
|
|
7701
|
+
] }),
|
|
7702
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: "edges" })
|
|
7703
|
+
] });
|
|
7704
|
+
}
|
|
7678
7705
|
const DEFAULT_MAX_VISIBLE = 5;
|
|
7679
7706
|
function GraphLegend({
|
|
7680
7707
|
items,
|
|
@@ -8662,6 +8689,7 @@ exports.FA2_ENABLED = FA2_ENABLED;
|
|
|
8662
8689
|
exports.FA2_GRAVITY = FA2_GRAVITY;
|
|
8663
8690
|
exports.FA2_SCALING_RATIO = FA2_SCALING_RATIO;
|
|
8664
8691
|
exports.FilterPanel = FilterPanel;
|
|
8692
|
+
exports.GraphBadge = GraphBadge;
|
|
8665
8693
|
exports.GraphCanvas = GraphCanvas;
|
|
8666
8694
|
exports.GraphLegend = GraphLegend;
|
|
8667
8695
|
exports.LABEL_COLOR = LABEL_COLOR;
|