diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index da1947f28..dbcc86071 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1505,20 +1505,20 @@ dst.id <-> src.dst_id name: "basic_sequence", text: `x: { - shape: sequence + shape: sequence_diagram } `, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "sequence", g.Objects[0].Attributes.Shape.Value) + diff.AssertStringEq(t, "sequence_diagram", g.Objects[0].Attributes.Shape.Value) }, }, { name: "root_sequence", - text: `shape: sequence + text: `shape: sequence_diagram `, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "sequence", g.Root.Attributes.Shape.Value) + diff.AssertStringEq(t, "sequence_diagram", g.Root.Attributes.Shape.Value) }, }, } diff --git a/d2target/d2target.go b/d2target/d2target.go index 6c15c0703..1582db666 100644 --- a/d2target/d2target.go +++ b/d2target/d2target.go @@ -255,29 +255,29 @@ func NewPoint(x, y int) Point { } const ( - ShapeRectangle = "rectangle" - ShapeSquare = "square" - ShapePage = "page" - ShapeParallelogram = "parallelogram" - ShapeDocument = "document" - ShapeCylinder = "cylinder" - ShapeQueue = "queue" - ShapePackage = "package" - ShapeStep = "step" - ShapeCallout = "callout" - ShapeStoredData = "stored_data" - ShapePerson = "person" - ShapeDiamond = "diamond" - ShapeOval = "oval" - ShapeCircle = "circle" - ShapeHexagon = "hexagon" - ShapeCloud = "cloud" - ShapeText = "text" - ShapeCode = "code" - ShapeClass = "class" - ShapeSQLTable = "sql_table" - ShapeImage = "image" - ShapeSequence = "sequence" + ShapeRectangle = "rectangle" + ShapeSquare = "square" + ShapePage = "page" + ShapeParallelogram = "parallelogram" + ShapeDocument = "document" + ShapeCylinder = "cylinder" + ShapeQueue = "queue" + ShapePackage = "package" + ShapeStep = "step" + ShapeCallout = "callout" + ShapeStoredData = "stored_data" + ShapePerson = "person" + ShapeDiamond = "diamond" + ShapeOval = "oval" + ShapeCircle = "circle" + ShapeHexagon = "hexagon" + ShapeCloud = "cloud" + ShapeText = "text" + ShapeCode = "code" + ShapeClass = "class" + ShapeSQLTable = "sql_table" + ShapeImage = "image" + ShapeSequenceDiagram = "sequence_diagram" ) var Shapes = []string{ @@ -303,7 +303,7 @@ var Shapes = []string{ ShapeClass, ShapeSQLTable, ShapeImage, - ShapeSequence, + ShapeSequenceDiagram, } func IsShape(s string) bool { @@ -347,30 +347,30 @@ func (text MText) GetColor(theme *d2themes.Theme, isItalic bool) string { } var DSL_SHAPE_TO_SHAPE_TYPE = map[string]string{ - "": shape.SQUARE_TYPE, - ShapeRectangle: shape.SQUARE_TYPE, - ShapeSquare: shape.REAL_SQUARE_TYPE, - ShapePage: shape.PAGE_TYPE, - ShapeParallelogram: shape.PARALLELOGRAM_TYPE, - ShapeDocument: shape.DOCUMENT_TYPE, - ShapeCylinder: shape.CYLINDER_TYPE, - ShapeQueue: shape.QUEUE_TYPE, - ShapePackage: shape.PACKAGE_TYPE, - ShapeStep: shape.STEP_TYPE, - ShapeCallout: shape.CALLOUT_TYPE, - ShapeStoredData: shape.STORED_DATA_TYPE, - ShapePerson: shape.PERSON_TYPE, - ShapeDiamond: shape.DIAMOND_TYPE, - ShapeOval: shape.OVAL_TYPE, - ShapeCircle: shape.CIRCLE_TYPE, - ShapeHexagon: shape.HEXAGON_TYPE, - ShapeCloud: shape.CLOUD_TYPE, - ShapeText: shape.TEXT_TYPE, - ShapeCode: shape.CODE_TYPE, - ShapeClass: shape.CLASS_TYPE, - ShapeSQLTable: shape.TABLE_TYPE, - ShapeImage: shape.IMAGE_TYPE, - ShapeSequence: shape.SQUARE_TYPE, + "": shape.SQUARE_TYPE, + ShapeRectangle: shape.SQUARE_TYPE, + ShapeSquare: shape.REAL_SQUARE_TYPE, + ShapePage: shape.PAGE_TYPE, + ShapeParallelogram: shape.PARALLELOGRAM_TYPE, + ShapeDocument: shape.DOCUMENT_TYPE, + ShapeCylinder: shape.CYLINDER_TYPE, + ShapeQueue: shape.QUEUE_TYPE, + ShapePackage: shape.PACKAGE_TYPE, + ShapeStep: shape.STEP_TYPE, + ShapeCallout: shape.CALLOUT_TYPE, + ShapeStoredData: shape.STORED_DATA_TYPE, + ShapePerson: shape.PERSON_TYPE, + ShapeDiamond: shape.DIAMOND_TYPE, + ShapeOval: shape.OVAL_TYPE, + ShapeCircle: shape.CIRCLE_TYPE, + ShapeHexagon: shape.HEXAGON_TYPE, + ShapeCloud: shape.CLOUD_TYPE, + ShapeText: shape.TEXT_TYPE, + ShapeCode: shape.CODE_TYPE, + ShapeClass: shape.CLASS_TYPE, + ShapeSQLTable: shape.TABLE_TYPE, + ShapeImage: shape.IMAGE_TYPE, + ShapeSequenceDiagram: shape.SQUARE_TYPE, } var SHAPE_TYPE_TO_DSL_SHAPE map[string]string