Skip to content

Commit

Permalink
Merge pull request meshery#146 from codeSafari10/styles-update
Browse files Browse the repository at this point in the history
update component styles schema
  • Loading branch information
aabidsofi19 committed Aug 23, 2024
2 parents 621cac0 + 31b3233 commit 3d7a6fa
Showing 1 changed file with 53 additions and 65 deletions.
118 changes: 53 additions & 65 deletions schemas/constructs/core.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@
"maxLength": 100,
"description": "API version of the object",
"pattern": "([a-z.])*(?!^/)v(alpha|beta|[0-9]+)([.-]*[a-z0-9]+)*$",
"example": [
"v1",
"v1alpha1",
"v2beta3",
"v1.custom-suffix"
]
"example": ["v1", "v1alpha1", "v2beta3", "v1.custom-suffix"]
},
"semverString": {
"type": "string",
Expand All @@ -46,11 +41,7 @@
"type": "object",
"description": "Common styles for all entities",
"additionalProperties": false,
"required": [
"primaryColor",
"svgColor",
"svgWhite"
],
"required": ["primaryColor", "svgColor", "svgWhite"],
"properties": {
"primaryColor": {
"type": "string",
Expand Down Expand Up @@ -101,11 +92,7 @@
"text-transform": {
"type": "string",
"description": "A transformation to apply to the label text",
"enum": [
"none",
"uppercase",
"lowercase"
]
"enum": ["none", "uppercase", "lowercase"]
},
"opacity": {
"type": "number",
Expand Down Expand Up @@ -187,20 +174,12 @@
"line-style": {
"type": "string",
"description": "The style of the edge\u2019s line.",
"enum": [
"solid",
"dotted",
"dashed"
]
"enum": ["solid", "dotted", "dashed"]
},
"line-cap": {
"type": "string",
"description": "The cap style of the edge\u2019s line; may be butt (default), round, or square. The cap may or may not be visible, depending on the shape of the node and the relative size of the node and edge. Caps other than butt extend beyond the specified endpoint of the edge.",
"enum": [
"butt",
"round",
"square"
],
"enum": ["butt", "round", "square"],
"default": "butt"
},
"line-opacity": {
Expand Down Expand Up @@ -235,10 +214,7 @@
"target-arrow-fill": {
"type": "string",
"description": "The fill state of the edge\u2019s source arrow",
"enum": [
"filled",
"hollow"
]
"enum": ["filled", "hollow"]
},
"mid-target-arrow-color": {
"type": "string",
Expand All @@ -265,10 +241,7 @@
"mid-target-arrow-fill": {
"type": "string",
"description": "The fill state of the edge\u2019s source arrow",
"enum": [
"filled",
"hollow"
]
"enum": ["filled", "hollow"]
},
"arrow-scale": {
"type": "number",
Expand All @@ -290,12 +263,7 @@
"componentStyles": {
"type": "object",
"description": "Visualization styles for a component",
"required": [
"shape",
"primaryColor",
"svgColor",
"svgWhite"
],
"required": ["shape", "primaryColor", "svgColor", "svgWhite"],
"allOf": [
{
"$ref": "#/definitions/styles"
Expand All @@ -308,10 +276,7 @@
"position": {
"type": "object",
"additionalProperties": false,
"required": [
"x",
"y"
],
"required": ["x", "y"],
"description": "The position of the node. If the position is set, the node is drawn at that position in the given dimensions. If the position is not set, the node is drawn at a random position.",
"properties": {
"x": {
Expand All @@ -324,6 +289,7 @@
}
}
},

"body-text": {
"type": "string",
"description": "The text to display for an element\u2019s body. Can give a path, e.g. data(id) will label with the elements id"
Expand Down Expand Up @@ -378,6 +344,11 @@
"type": "number",
"description": "The height of the node\u2019s body"
},

"background-image": {
"type": "string",
"description": "The URL that points to the image to show in the node."
},
"background-color": {
"type": "string",
"description": "The colour of the node\u2019s body. Colours may be specified by name (e.g. red), hex (e.g. #ff0000 or #f00), RGB (e.g. rgb(255, 0, 0)), or HSL (e.g. hsl(0, 100%, 50%))."
Expand All @@ -394,6 +365,39 @@
"maximum": 1,
"minimum": 0
},
"background-position-x": {
"type": "string",
"description": "The x position of the background image, measured in percent (e.g. 50%) or pixels (e.g. 10px)"
},
"background-position-y": {
"type": "string",
"description": "The y position of the background image, measured in percent (e.g. 50%) or pixels (e.g. 10px)"
},
"background-offset-x": {
"type": "string",
"description": "The x offset of the background image, measured in percent (e.g. 50%) or pixels (e.g. 10px)"
},
"background-offset-y": {
"type": "string",
"description": "The y offset of the background image, measured in percent (e.g. 50%) or pixels (e.g. 10px)"
},

"background-fit": {
"type": "string",
"description": "How the background image is fit to the node. Can be 'none', 'contain', or 'cover'."
},
"background-clip": {
"type": "string",
"description": "How the background image is clipped to the node. Can be 'none', 'node', or 'node-border'."
},
"background-width-relative-to": {
"type": "string",
"description": "How the background image\u2019s width is determined. Can be 'none', 'inner', or 'outer'."
},
"background-height-relative-to": {
"type": "string",
"description": "How the background image\u2019s height is determined. Can be 'none', 'inner', or 'outer'."
},
"border-width": {
"type": "number",
"description": "The size of the node\u2019s border.",
Expand All @@ -402,12 +406,7 @@
"border-style": {
"type": "string",
"description": "The style of the node\u2019s border",
"enum": [
"solid",
"dotted",
"dashed",
"double"
]
"enum": ["solid", "dotted", "dashed", "double"]
},
"border-color": {
"type": "string",
Expand All @@ -427,29 +426,18 @@
"text-halign": {
"type": "string",
"description": "The horizontal alignment of a node\u2019s label",
"enum": [
"left",
"center",
"right"
]
"enum": ["left", "center", "right"]
},
"text-valign": {
"type": "string",
"description": "The vertical alignment of a node\u2019s label",
"enum": [
"top",
"center",
"bottom"
]
"enum": ["top", "center", "bottom"]
},
"ghost": {
"type": "string",
"description": "Whether to use the ghost effect, a semitransparent duplicate of the element drawn at an offset.",
"default": "no",
"enum": [
"yes",
"no"
]
"enum": ["yes", "no"]
},
"active-bg-color": {
"type": "string",
Expand Down Expand Up @@ -504,4 +492,4 @@
]
}
}
}
}

0 comments on commit 3d7a6fa

Please sign in to comment.