mirror of
https://github.com/weaveworks/scope.git
synced 2026-02-14 18:09:59 +00:00
Add new node shapes for k8s combined view
This commit is contained in:
@@ -16,6 +16,9 @@ import {
|
||||
squareShapeProps,
|
||||
hexagonShapeProps,
|
||||
heptagonShapeProps,
|
||||
triangleShapeProps,
|
||||
pentagonShapeProps,
|
||||
octogonShapeProps,
|
||||
} from '../utils/node-shape-utils';
|
||||
|
||||
|
||||
@@ -74,3 +77,6 @@ export const NodeShapeCircle = props => NodeShape('circle', circleElement, circl
|
||||
export const NodeShapeHexagon = props => NodeShape('hexagon', pathElement, hexagonShapeProps, props);
|
||||
export const NodeShapeHeptagon = props => NodeShape('heptagon', pathElement, heptagonShapeProps, props);
|
||||
export const NodeShapeSquare = props => NodeShape('square', rectangleElement, squareShapeProps, props);
|
||||
export const NodeShapeTriangle = props => NodeShape('triangle', pathElement, triangleShapeProps, props);
|
||||
export const NodeShapePentagon = props => NodeShape('pentagon', pathElement, pentagonShapeProps, props);
|
||||
export const NodeShapeOctogon = props => NodeShape('octogon', pathElement, octogonShapeProps, props);
|
||||
|
||||
@@ -19,6 +19,9 @@ import {
|
||||
NodeShapeSquare,
|
||||
NodeShapeHexagon,
|
||||
NodeShapeHeptagon,
|
||||
NodeShapeTriangle,
|
||||
NodeShapeOctogon,
|
||||
NodeShapePentagon,
|
||||
} from './node-shapes';
|
||||
|
||||
|
||||
@@ -29,6 +32,9 @@ const nodeShapes = {
|
||||
heptagon: NodeShapeHeptagon,
|
||||
square: NodeShapeSquare,
|
||||
cloud: NodeShapeCloud,
|
||||
triangle: NodeShapeTriangle,
|
||||
octogon: NodeShapeOctogon,
|
||||
pentagon: NodeShapePentagon
|
||||
};
|
||||
|
||||
function stackedShape(Shape) {
|
||||
|
||||
@@ -23,5 +23,8 @@ function curvedUnitPolygonPath(n) {
|
||||
export const squareShapeProps = { width: 1.8, height: 1.8, rx: 0.4, ry: 0.4, x: -0.9, y: -0.9 };
|
||||
export const heptagonShapeProps = { d: curvedUnitPolygonPath(7) };
|
||||
export const hexagonShapeProps = { d: curvedUnitPolygonPath(6) };
|
||||
export const triangleShapeProps = { d: curvedUnitPolygonPath(3) };
|
||||
export const pentagonShapeProps = { d: curvedUnitPolygonPath(5) };
|
||||
export const octogonShapeProps = { d: curvedUnitPolygonPath(8) };
|
||||
export const cloudShapeProps = { d: UNIT_CLOUD_PATH };
|
||||
export const circleShapeProps = { r: 1 };
|
||||
|
||||
@@ -33,6 +33,9 @@ const (
|
||||
Heptagon = "heptagon"
|
||||
Hexagon = "hexagon"
|
||||
Cloud = "cloud"
|
||||
Triangle = "triangle"
|
||||
Pentagon = "pentagon"
|
||||
Octogon = "octogon"
|
||||
|
||||
// Used when counting the number of containers
|
||||
ContainersKey = "containers"
|
||||
@@ -155,7 +158,7 @@ func MakeReport() Report {
|
||||
WithLabel("host", "hosts"),
|
||||
|
||||
Pod: MakeTopology().
|
||||
WithShape(Heptagon).
|
||||
WithShape(Octogon).
|
||||
WithLabel("pod", "pods"),
|
||||
|
||||
Service: MakeTopology().
|
||||
@@ -167,11 +170,11 @@ func MakeReport() Report {
|
||||
WithLabel("deployment", "deployments"),
|
||||
|
||||
ReplicaSet: MakeTopology().
|
||||
WithShape(Heptagon).
|
||||
WithShape(Pentagon).
|
||||
WithLabel("replica set", "replica sets"),
|
||||
|
||||
DaemonSet: MakeTopology().
|
||||
WithShape(Heptagon).
|
||||
WithShape(Triangle).
|
||||
WithLabel("daemonset", "daemonsets"),
|
||||
|
||||
Overlay: MakeTopology().
|
||||
|
||||
Reference in New Issue
Block a user