From 620c7af73c24fc63890c2e848976fed70d7e2a4e Mon Sep 17 00:00:00 2001 From: -1 Date: Tue, 14 May 2019 01:41:20 +0200 Subject: [PATCH] [cytoscape] fixed typos and added new style options (#35313) * add and fix line-styles * fix typo * add text-wrap style * add tests --- types/cytoscape/cytoscape-tests.ts | 11 ++++++++++- types/cytoscape/index.d.ts | 6 +++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/types/cytoscape/cytoscape-tests.ts b/types/cytoscape/cytoscape-tests.ts index 8ea28a323d..bf14b4aedf 100644 --- a/types/cytoscape/cytoscape-tests.ts +++ b/types/cytoscape/cytoscape-tests.ts @@ -47,7 +47,8 @@ const showAllStyle: cytoscape.Stylesheet[] = [ { selector: 'edge', css: { - 'target-arrow-shape': 'triangle' + 'target-arrow-shape': 'triangle', + 'curve-style': 'taxi', } }, { @@ -58,6 +59,14 @@ const showAllStyle: cytoscape.Stylesheet[] = [ 'target-arrow-color': 'black', 'source-arrow-color': 'black' } + }, + { + selector: 'node.lesstext', + style: { + label: 'data(name)', + 'text-wrap': 'ellipsis', + 'text-max-width': '200', + } } ]; diff --git a/types/cytoscape/index.d.ts b/types/cytoscape/index.d.ts index 938894d0aa..7384f57ec9 100644 --- a/types/cytoscape/index.d.ts +++ b/types/cytoscape/index.d.ts @@ -3668,7 +3668,7 @@ declare namespace cytoscape { * Smaller node shapes, like triangle, will not be as aesthetically pleasing. * Also note that edge arrows are unsupported for haystack edges. */ - "curve-style"?: "haystack" | "bezier" | "unbundled" | "segments"; + "curve-style"?: "haystack" | "straight" | "bezier" | "unbundled-bezier" | "segments" | "taxi"; /** * The colour of the edge’s line. */ @@ -3939,7 +3939,7 @@ declare namespace cytoscape { * * "none" for no wrapping (including manual newlines ) or * * "wrap" for manual and/ or autowrapping. */ - "text-wrap": "none" | "wrap"; + "text-wrap": "none" | "wrap" | "ellipsis"; /** * The maximum width for wrapped text, * applied when "text-wrap" is set to wrap. @@ -4080,7 +4080,7 @@ declare namespace cytoscape { /** * The shape to use for the label background. */ - "text-background-shape": "ractangle" | "roundrectangle"; + "text-background-shape": "rectangle" | "roundrectangle"; /** * Border: