From a39bfce697bfe77a21db60092550b3089afbde7e Mon Sep 17 00:00:00 2001 From: Alexander Wang Date: Tue, 29 Nov 2022 16:02:37 -0800 Subject: [PATCH] 2022-11-29 04:02:37PM --- ci/release/changelogs/next.md | 2 +- d2compiler/compile.go | 10 +- d2compiler/compile_test.go | 22 +- d2graph/d2graph.go | 28 +- d2layouts/d2dagrelayout/layout.go | 10 +- d2layouts/d2elklayout/layout.go | 10 +- e2etests/stable_test.go | 6 +- .../testdata/sanity/1_to_2/elk/board.exp.json | 36 +- .../testdata/sanity/1_to_2/elk/sketch.exp.svg | 4 +- .../testdata/sanity/basic/elk/board.exp.json | 12 +- .../testdata/sanity/basic/elk/sketch.exp.svg | 4 +- .../sanity/child_to_child/elk/board.exp.json | 20 +- .../sanity/child_to_child/elk/sketch.exp.svg | 4 +- .../connection_label/elk/board.exp.json | 12 +- .../connection_label/elk/sketch.exp.svg | 10 +- .../stable/all_shapes/elk/board.exp.json | 154 +- .../stable/all_shapes/elk/sketch.exp.svg | 4 +- .../all_shapes_multiple/elk/board.exp.json | 154 +- .../all_shapes_multiple/elk/sketch.exp.svg | 4 +- .../all_shapes_shadow/elk/board.exp.json | 154 +- .../all_shapes_shadow/elk/sketch.exp.svg | 4 +- .../arrowhead_adjustment/elk/board.exp.json | 88 +- .../arrowhead_adjustment/elk/sketch.exp.svg | 4 +- .../arrowhead_labels/elk/board.exp.json | 14 +- .../arrowhead_labels/elk/sketch.exp.svg | 10 +- .../stable/binary_tree/elk/board.exp.json | 228 +-- .../stable/binary_tree/elk/sketch.exp.svg | 4 +- .../testdata/stable/chaos1/elk/board.exp.json | 40 +- .../testdata/stable/chaos1/elk/sketch.exp.svg | 16 +- .../testdata/stable/chaos2/elk/board.exp.json | 288 +-- .../testdata/stable/chaos2/elk/sketch.exp.svg | 58 +- .../child_parent_edges/dagre/board.exp.json | 80 +- .../child_parent_edges/dagre/sketch.exp.svg | 4 +- .../child_parent_edges/elk/board.exp.json | 40 +- .../child_parent_edges/elk/sketch.exp.svg | 4 +- .../circular_dependency/elk/board.exp.json | 40 +- .../circular_dependency/elk/sketch.exp.svg | 4 +- .../stable/code_snippet/elk/board.exp.json | 28 +- .../stable/code_snippet/elk/sketch.exp.svg | 6 +- .../connected_container/elk/board.exp.json | 48 +- .../connected_container/elk/sketch.exp.svg | 4 +- .../stable/container_edges/elk/board.exp.json | 120 +- .../stable/container_edges/elk/sketch.exp.svg | 4 +- .../testdata/stable/dense/elk/board.exp.json | 404 ++-- .../testdata/stable/dense/elk/sketch.exp.svg | 4 +- .../different_subgraphs/elk/board.exp.json | 284 +-- .../different_subgraphs/elk/sketch.exp.svg | 4 +- .../stable/direction/dagre/board.exp.json | 1141 +++++++++++ .../stable/direction/dagre/sketch.exp.svg | 24 + .../stable/direction/elk/board.exp.json | 1033 ++++++++++ .../stable/direction/elk/sketch.exp.svg | 24 + .../stable/font_colors/elk/board.exp.json | 12 +- .../stable/font_colors/elk/sketch.exp.svg | 10 +- .../giant_markdown_test/elk/board.exp.json | 28 +- .../giant_markdown_test/elk/sketch.exp.svg | 6 +- .../testdata/stable/hr/elk/board.exp.json | 28 +- .../testdata/stable/hr/elk/sketch.exp.svg | 6 +- .../testdata/stable/images/elk/board.exp.json | 12 +- .../testdata/stable/images/elk/sketch.exp.svg | 4 +- .../stable/investigate/elk/board.exp.json | 434 ++-- .../stable/investigate/elk/sketch.exp.svg | 40 +- .../stable/large_arch/elk/board.exp.json | 396 ++-- .../stable/large_arch/elk/sketch.exp.svg | 4 +- .../testdata/stable/latex/elk/board.exp.json | 96 +- .../testdata/stable/latex/elk/sketch.exp.svg | 10 +- .../testdata/stable/li1/elk/board.exp.json | 26 +- .../testdata/stable/li1/elk/sketch.exp.svg | 6 +- .../testdata/stable/li2/elk/board.exp.json | 26 +- .../testdata/stable/li2/elk/sketch.exp.svg | 6 +- .../testdata/stable/li3/elk/board.exp.json | 28 +- .../testdata/stable/li3/elk/sketch.exp.svg | 6 +- .../testdata/stable/li4/elk/board.exp.json | 28 +- .../testdata/stable/li4/elk/sketch.exp.svg | 6 +- .../stable/lone_h1/elk/board.exp.json | 26 +- .../stable/lone_h1/elk/sketch.exp.svg | 6 +- .../stable/markdown/elk/board.exp.json | 28 +- .../stable/markdown/elk/sketch.exp.svg | 6 +- .../md_code_block_fenced/elk/board.exp.json | 26 +- .../md_code_block_fenced/elk/sketch.exp.svg | 6 +- .../md_code_block_indented/elk/board.exp.json | 28 +- .../md_code_block_indented/elk/sketch.exp.svg | 6 +- .../stable/md_code_inline/elk/board.exp.json | 24 +- .../stable/md_code_inline/elk/sketch.exp.svg | 6 +- .../stable/multiple_trees/elk/board.exp.json | 364 ++-- .../stable/multiple_trees/elk/sketch.exp.svg | 4 +- .../stable/n22_e32/elk/board.exp.json | 540 ++--- .../stable/n22_e32/elk/sketch.exp.svg | 4 +- .../one_container_loop/elk/board.exp.json | 116 +- .../one_container_loop/elk/sketch.exp.svg | 4 +- .../elk/board.exp.json | 120 +- .../elk/sketch.exp.svg | 4 +- e2etests/testdata/stable/p/elk/board.exp.json | 26 +- e2etests/testdata/stable/p/elk/sketch.exp.svg | 6 +- .../testdata/stable/pre/elk/board.exp.json | 28 +- .../testdata/stable/pre/elk/sketch.exp.svg | 6 +- .../stable/sql_tables/elk/board.exp.json | 54 +- .../stable/sql_tables/elk/sketch.exp.svg | 64 +- .../stable/square_3d/elk/board.exp.json | 14 +- .../stable/square_3d/elk/sketch.exp.svg | 4 +- .../elk/board.exp.json | 240 +-- .../elk/sketch.exp.svg | 4 +- .../stable/stylish/elk/board.exp.json | 14 +- .../stable/stylish/elk/sketch.exp.svg | 4 +- .../testdata/stable/us_map/elk/board.exp.json | 1808 ++++++++--------- .../testdata/stable/us_map/elk/sketch.exp.svg | 4 +- .../container_child_edge/elk/board.exp.json | 36 +- .../container_child_edge/elk/sketch.exp.svg | 16 +- .../TestCompile/basic_icon.exp.json | 6 +- .../TestCompile/basic_sequence.exp.json | 6 +- .../TestCompile/basic_shape.exp.json | 6 +- .../TestCompile/basic_style.exp.json | 6 +- .../TestCompile/class_paren.exp.json | 6 +- .../TestCompile/class_style.exp.json | 6 +- .../TestCompile/default_direction.exp.json | 100 + testdata/d2compiler/TestCompile/edge.exp.json | 12 +- .../edge_arrowhead_fields.exp.json | 16 +- .../TestCompile/edge_chain.exp.json | 18 +- .../TestCompile/edge_chain_map.exp.json | 18 +- .../TestCompile/edge_column_index.exp.json | 12 +- .../TestCompile/edge_exclusive_style.exp.json | 12 +- .../TestCompile/edge_flat_arrowhead.exp.json | 14 +- .../edge_flat_label_arrowhead.exp.json | 14 +- .../TestCompile/edge_in_column.exp.json | 6 +- .../TestCompile/edge_index.exp.json | 12 +- .../TestCompile/edge_index_map.exp.json | 12 +- .../TestCompile/edge_index_nested.exp.json | 16 +- .../edge_index_nested_cross_scope.exp.json | 16 +- .../edge_key_group_flat_nested.exp.json | 16 +- ..._key_group_flat_nested_underscore.exp.json | 16 +- ..._group_map_flat_nested_underscore.exp.json | 16 +- ...e_key_group_map_nested_underscore.exp.json | 16 +- .../TestCompile/edge_label_map.exp.json | 12 +- .../d2compiler/TestCompile/edge_map.exp.json | 12 +- .../TestCompile/edge_map_arrowhead.exp.json | 14 +- .../TestCompile/edge_map_group_flat.exp.json | 12 +- .../edge_map_group_semiflat.exp.json | 12 +- .../TestCompile/edge_map_nested.exp.json | 12 +- .../TestCompile/edge_map_nested_flat.exp.json | 12 +- .../TestCompile/edge_mixed_arrowhead.exp.json | 16 +- .../edge_non_shape_arrowhead.exp.json | 14 +- .../edge_semiflat_arrowhead.exp.json | 14 +- .../TestCompile/escaped_id.exp.json | 6 +- .../TestCompile/image_style.exp.json | 6 +- .../TestCompile/invalid_direction.exp.json | 12 + .../TestCompile/nested_sql.exp.json | 10 +- .../d2compiler/TestCompile/path_link.exp.json | 6 +- .../reserved_icon_near_style.exp.json | 10 +- .../TestCompile/root_direction.exp.json | 66 + .../TestCompile/root_sequence.exp.json | 2 +- .../TestCompile/set_direction.exp.json | 139 ++ .../d2compiler/TestCompile/sql_paren.exp.json | 6 +- .../TestCompile/stroke-width.exp.json | 6 +- .../TestCompile/table_style.exp.json | 6 +- .../TestCompile/table_style_map.exp.json | 6 +- .../TestCompile/underscore_edge.exp.json | 12 +- .../underscore_edge_chain.exp.json | 18 +- .../underscore_edge_existing.exp.json | 18 +- .../underscore_edge_index.exp.json | 16 +- .../underscore_edge_nested.exp.json | 16 +- .../underscore_parent_create.exp.json | 10 +- .../underscore_parent_not_root.exp.json | 14 +- .../underscore_parent_preference_1.exp.json | 10 +- .../underscore_parent_preference_2.exp.json | 10 +- .../underscore_parent_squared.exp.json | 14 +- .../d2compiler/TestCompile/url_link.exp.json | 6 +- testdata/d2oracle/TestCreate/base.exp.json | 6 +- .../d2oracle/TestCreate/container.exp.json | 10 +- .../TestCreate/container_edge.exp.json | 16 +- .../TestCreate/container_edge_label.exp.json | 16 +- testdata/d2oracle/TestCreate/edge.exp.json | 12 +- .../d2oracle/TestCreate/edge_nested.exp.json | 16 +- .../d2oracle/TestCreate/edge_scope.exp.json | 16 +- .../TestCreate/edge_scope_flat.exp.json | 16 +- .../TestCreate/edge_scope_nested.exp.json | 20 +- .../d2oracle/TestCreate/edge_unique.exp.json | 30 +- testdata/d2oracle/TestCreate/gen_key.exp.json | 10 +- .../d2oracle/TestCreate/gen_key_n.exp.json | 58 +- .../TestCreate/gen_key_nested.exp.json | 22 +- .../TestCreate/gen_key_scope.exp.json | 22 +- .../TestCreate/gen_key_suffix.exp.json | 10 +- .../TestCreate/make_scope_multiline.exp.json | 10 +- .../make_scope_multiline_spacing_1.exp.json | 18 +- .../make_scope_multiline_spacing_2.exp.json | 18 +- testdata/d2oracle/TestCreate/nested.exp.json | 14 +- testdata/d2oracle/TestCreate/scope.exp.json | 18 +- .../TestDelete/breakup_arrowhead.exp.json | 6 +- .../d2oracle/TestDelete/children.exp.json | 16 +- .../TestDelete/children_conflicts.exp.json | 10 +- .../children_edge_conflicts.exp.json | 16 +- .../children_edges_flat_conflicts.exp.json | 26 +- .../children_flat_conflicts.exp.json | 10 +- .../children_multiple_conflicts.exp.json | 20 +- .../children_nested_conflicts.exp.json | 14 +- ...ldren_nested_referenced_conflicts.exp.json | 14 +- .../children_no_self_conflict.exp.json | 6 +- .../TestDelete/children_order.exp.json | 18 +- .../children_referenced_conflicts.exp.json | 10 +- .../TestDelete/children_scope.exp.json | 24 +- .../TestDelete/container_near.exp.json | 14 +- .../d2oracle/TestDelete/delete_icon.exp.json | 10 +- .../d2oracle/TestDelete/delete_link.exp.json | 6 +- .../d2oracle/TestDelete/delete_near.exp.json | 10 +- .../delete_needed_flat_near.exp.json | 10 +- .../delete_redundant_flat_near.exp.json | 10 +- .../TestDelete/delete_tooltip.exp.json | 6 +- .../edge_both_identical_childs.exp.json | 20 +- .../d2oracle/TestDelete/edge_common.exp.json | 12 +- .../TestDelete/edge_common_2.exp.json | 12 +- .../TestDelete/edge_common_3.exp.json | 14 +- .../TestDelete/edge_common_4.exp.json | 14 +- .../TestDelete/edge_conflict.exp.json | 20 +- .../TestDelete/edge_decrement.exp.json | 18 +- .../d2oracle/TestDelete/edge_first.exp.json | 34 +- .../TestDelete/edge_flat_style.exp.json | 6 +- .../TestDelete/edge_identical_child.exp.json | 24 +- .../TestDelete/edge_key_style.exp.json | 12 +- .../d2oracle/TestDelete/edge_last.exp.json | 40 +- .../TestDelete/edge_map_style.exp.json | 12 +- .../d2oracle/TestDelete/edge_middle.exp.json | 40 +- .../d2oracle/TestDelete/empty_map.exp.json | 10 +- testdata/d2oracle/TestDelete/flat.exp.json | 2 +- .../TestDelete/flat_reserved.exp.json | 12 +- .../TestDelete/hoist_children.exp.json | 10 +- .../TestDelete/hoist_edge_children.exp.json | 16 +- .../TestDelete/key_with_edges.exp.json | 14 +- .../TestDelete/key_with_edges_2.exp.json | 10 +- .../TestDelete/key_with_edges_3.exp.json | 10 +- .../TestDelete/key_with_edges_4.exp.json | 14 +- .../d2oracle/TestDelete/multi_near.exp.json | 18 +- .../multi_path_map_conflict.exp.json | 14 +- .../multi_path_map_no_conflict.exp.json | 14 +- .../multiple_flat_middle_container.exp.json | 14 +- .../TestDelete/multiple_flat_style.exp.json | 6 +- .../TestDelete/multiple_map_styles.exp.json | 6 +- testdata/d2oracle/TestDelete/near.exp.json | 6 +- testdata/d2oracle/TestDelete/nested.exp.json | 14 +- .../d2oracle/TestDelete/nested_2.exp.json | 14 +- .../TestDelete/nested_edge_key_style.exp.json | 16 +- .../TestDelete/nested_flat_style.exp.json | 6 +- .../TestDelete/nested_reserved.exp.json | 14 +- .../nested_underscore_update.exp.json | 10 +- .../d2oracle/TestDelete/node_in_edge.exp.json | 30 +- .../TestDelete/node_in_edge_last.exp.json | 36 +- .../only_delete_edge_reserved.exp.json | 12 +- .../only_delete_obj_reserved.exp.json | 12 +- testdata/d2oracle/TestDelete/order_1.exp.json | 16 +- testdata/d2oracle/TestDelete/order_2.exp.json | 10 +- testdata/d2oracle/TestDelete/order_3.exp.json | 10 +- testdata/d2oracle/TestDelete/order_4.exp.json | 6 +- testdata/d2oracle/TestDelete/order_5.exp.json | 26 +- testdata/d2oracle/TestDelete/order_6.exp.json | 18 +- testdata/d2oracle/TestDelete/order_7.exp.json | 22 +- testdata/d2oracle/TestDelete/order_8.exp.json | 22 +- .../d2oracle/TestDelete/shape_class.exp.json | 6 +- .../TestDelete/shape_sql_table.exp.json | 16 +- .../TestDelete/singular_flat_style.exp.json | 6 +- .../TestDelete/singular_map_style.exp.json | 6 +- .../underscore_no_conflict.exp.json | 14 +- .../TestDelete/underscore_remove.exp.json | 26 +- .../TestMove/append_multiple_styles.exp.json | 10 +- testdata/d2oracle/TestMove/basic.exp.json | 6 +- .../d2oracle/TestMove/basic_nested.exp.json | 10 +- .../TestMove/basic_out_of_container.exp.json | 10 +- .../TestMove/between_containers.exp.json | 14 +- .../TestMove/chain_connected_nested.exp.json | 18 +- ..._connected_nested_no_extra_create.exp.json | 22 +- .../TestMove/connected_nested.exp.json | 16 +- .../d2oracle/TestMove/container_near.exp.json | 26 +- .../TestMove/edge_across_containers.exp.json | 20 +- .../d2oracle/TestMove/edge_basic.exp.json | 12 +- .../TestMove/edge_chain_basic.exp.json | 18 +- .../TestMove/edge_chain_circular.exp.json | 18 +- .../edge_chain_into_container.exp.json | 22 +- .../edge_chain_out_container.exp.json | 22 +- .../d2oracle/TestMove/edge_conflict.exp.json | 24 +- .../TestMove/edge_into_container.exp.json | 20 +- .../TestMove/edge_nested_basic.exp.json | 16 +- .../TestMove/edge_out_of_container.exp.json | 16 +- .../d2oracle/TestMove/extend_map.exp.json | 18 +- .../TestMove/extend_stationary_path.exp.json | 14 +- .../TestMove/flat_between_containers.exp.json | 14 +- .../d2oracle/TestMove/flat_merge.exp.json | 18 +- .../TestMove/flat_middle_container.exp.json | 18 +- .../TestMove/flat_nested_merge.exp.json | 42 +- .../flat_nested_merge_multiple_refs.exp.json | 34 +- .../flat_reparent_with_map_value.exp.json | 10 +- ...lat_reparent_with_mixed_map_value.exp.json | 14 +- .../flat_reparent_with_value.exp.json | 10 +- .../d2oracle/TestMove/flat_style.exp.json | 10 +- .../TestMove/full_edge_slice.exp.json | 22 +- .../d2oracle/TestMove/full_slice.exp.json | 14 +- testdata/d2oracle/TestMove/gnarly_1.exp.json | 56 +- .../hoist_container_children.exp.json | 18 +- .../into_container_existing_map.exp.json | 14 +- .../into_container_nonexisting_map.exp.json | 10 +- .../into_container_with_flat_keys.exp.json | 10 +- .../into_container_with_flat_style.exp.json | 10 +- .../d2oracle/TestMove/map_transplant.exp.json | 18 +- .../d2oracle/TestMove/map_with_label.exp.json | 14 +- .../TestMove/merge_nested_maps.exp.json | 34 +- .../d2oracle/TestMove/merge_reserved.exp.json | 26 +- .../TestMove/middle_container.exp.json | 14 +- .../TestMove/move_container_children.exp.json | 22 +- .../move_container_conflict_children.exp.json | 22 +- .../move_into_key_with_value.exp.json | 10 +- .../TestMove/move_out_of_edge.exp.json | 28 +- .../TestMove/move_out_of_nested_edge.exp.json | 28 +- .../TestMove/multiple_nesting_levels.exp.json | 30 +- testdata/d2oracle/TestMove/near.exp.json | 10 +- .../d2oracle/TestMove/nhooyr_one.exp.json | 18 +- .../d2oracle/TestMove/nhooyr_two.exp.json | 28 +- .../d2oracle/TestMove/parentheses.exp.json | 16 +- .../TestMove/partial_edge_slice.exp.json | 16 +- .../d2oracle/TestMove/partial_slice.exp.json | 10 +- testdata/d2oracle/TestMove/rename_2.exp.json | 22 +- testdata/d2oracle/TestMove/reuse_map.exp.json | 22 +- .../d2oracle/TestMove/slice_style.exp.json | 10 +- .../TestMove/underscore_children.exp.json | 10 +- .../underscore_edge_children.exp.json | 16 +- .../underscore_edge_container_1.exp.json | 16 +- .../underscore_edge_container_2.exp.json | 16 +- .../underscore_edge_container_3.exp.json | 16 +- .../underscore_edge_container_4.exp.json | 16 +- .../underscore_edge_container_5.exp.json | 16 +- .../TestMove/underscore_edge_split.exp.json | 24 +- .../TestMove/underscore_merge.exp.json | 14 +- .../TestMove/underscore_split.exp.json | 18 +- .../TestMove/underscore_split_out.exp.json | 22 +- .../TestMove/underscore_transplant.exp.json | 14 +- .../d2oracle/TestMove/unique_name.exp.json | 18 +- .../unique_name_with_references.exp.json | 24 +- testdata/d2oracle/TestRename/arrows.exp.json | 12 +- .../d2oracle/TestRename/arrows_chain.exp.json | 24 +- .../TestRename/arrows_complex.exp.json | 20 +- .../TestRename/arrows_trim_common.exp.json | 28 +- .../TestRename/arrows_trim_common_2.exp.json | 28 +- .../TestRename/complex_edge_1.exp.json | 20 +- .../TestRename/complex_edge_2.exp.json | 20 +- .../d2oracle/TestRename/conflict.exp.json | 10 +- .../d2oracle/TestRename/conflict_2.exp.json | 22 +- .../TestRename/conflict_with_dots.exp.json | 10 +- .../d2oracle/TestRename/container.exp.json | 80 +- testdata/d2oracle/TestRename/edges.exp.json | 46 +- testdata/d2oracle/TestRename/flat.exp.json | 6 +- .../d2oracle/TestRename/generated.exp.json | 6 +- testdata/d2oracle/TestRename/near.exp.json | 10 +- testdata/d2oracle/TestRename/nested.exp.json | 22 +- testdata/d2oracle/TestSet/base.exp.json | 6 +- .../TestSet/block_string_multiline.exp.json | 6 +- .../TestSet/block_string_oneline.exp.json | 6 +- testdata/d2oracle/TestSet/edge.exp.json | 12 +- .../TestSet/edge_append_style.exp.json | 12 +- testdata/d2oracle/TestSet/edge_chain.exp.json | 22 +- .../TestSet/edge_chain_append_style.exp.json | 18 +- .../edge_chain_existing_style.exp.json | 18 +- .../TestSet/edge_chain_nested_set.exp.json | 22 +- .../d2oracle/TestSet/edge_index_case.exp.json | 30 +- .../TestSet/edge_index_nested.exp.json | 16 +- .../TestSet/edge_key_and_key.exp.json | 16 +- testdata/d2oracle/TestSet/edge_label.exp.json | 12 +- .../TestSet/edge_merge_style.exp.json | 12 +- .../TestSet/edge_nested_label_set.exp.json | 16 +- .../TestSet/edge_nested_style_set.exp.json | 16 +- .../TestSet/expanded_map_style.exp.json | 6 +- testdata/d2oracle/TestSet/icon.exp.json | 6 +- .../d2oracle/TestSet/inline_style.exp.json | 6 +- testdata/d2oracle/TestSet/label.exp.json | 6 +- .../d2oracle/TestSet/label_primary.exp.json | 16 +- .../d2oracle/TestSet/label_replace.exp.json | 6 +- .../d2oracle/TestSet/label_unset.exp.json | 6 +- .../d2oracle/TestSet/map_key_missing.exp.json | 12 +- .../d2oracle/TestSet/nested_alex.exp.json | 16 +- testdata/d2oracle/TestSet/new_style.exp.json | 6 +- .../d2oracle/TestSet/replace_shape.exp.json | 6 +- .../d2oracle/TestSet/replace_style.exp.json | 6 +- .../TestSet/replace_style_edgecase.exp.json | 6 +- testdata/d2oracle/TestSet/shape.exp.json | 6 +- .../TestSet/shape_nested_style_set.exp.json | 6 +- 378 files changed, 8251 insertions(+), 5730 deletions(-) create mode 100644 e2etests/testdata/stable/direction/dagre/board.exp.json create mode 100644 e2etests/testdata/stable/direction/dagre/sketch.exp.svg create mode 100644 e2etests/testdata/stable/direction/elk/board.exp.json create mode 100644 e2etests/testdata/stable/direction/elk/sketch.exp.svg create mode 100644 testdata/d2compiler/TestCompile/default_direction.exp.json create mode 100644 testdata/d2compiler/TestCompile/invalid_direction.exp.json create mode 100644 testdata/d2compiler/TestCompile/root_direction.exp.json create mode 100644 testdata/d2compiler/TestCompile/set_direction.exp.json diff --git a/ci/release/changelogs/next.md b/ci/release/changelogs/next.md index 54aa17b86..4e381a2cf 100644 --- a/ci/release/changelogs/next.md +++ b/ci/release/changelogs/next.md @@ -2,7 +2,7 @@ - Latex is now supported. See [docs](https://d2lang.com/tour/text) for more. [#229](https://github.com/terrastruct/d2/pull/229) -- `orientation` keyword is now supported to specify horizontal or vertical layouts. See +- `direction` keyword is now supported to specify `up`, `down`, `right`, `left` layouts. See [docs](https://d2lang.com/tour/layouts) for more. [#251](https://github.com/terrastruct/d2/pull/251) - Arrowhead labels are now supported. [#182](https://github.com/terrastruct/d2/pull/182) diff --git a/d2compiler/compile.go b/d2compiler/compile.go index 7516fa9fe..b5de7915b 100644 --- a/d2compiler/compile.go +++ b/d2compiler/compile.go @@ -13,6 +13,7 @@ import ( "oss.terrastruct.com/d2/d2graph" "oss.terrastruct.com/d2/d2parser" "oss.terrastruct.com/d2/d2target" + "oss.terrastruct.com/d2/lib/go2" ) // TODO: should Parse even be exported? guess not. IR should contain list of files and @@ -356,12 +357,13 @@ func (c *compiler) applyScalar(attrs *d2graph.Attributes, reserved string, box d case "link": attrs.Link = scalar.ScalarString() return - case "orientation": - if scalar.ScalarString() != "horizontal" && scalar.ScalarString() != "vertical" { - c.errorf(scalar.GetRange().Start, scalar.GetRange().End, `expected "horizontal" or "vertical" orientation, got %q`, scalar.ScalarString()) + case "direction": + dirs := []string{"up", "down", "right", "left"} + if !go2.Contains(dirs, scalar.ScalarString()) { + c.errorf(scalar.GetRange().Start, scalar.GetRange().End, `direction must be one of %v, got %q`, strings.Join(dirs, ", "), scalar.ScalarString()) return } - attrs.Orientation.Value = scalar.ScalarString() + attrs.Direction.Value = scalar.ScalarString() return } diff --git a/d2compiler/compile_test.go b/d2compiler/compile_test.go index 294503a56..07dee8f17 100644 --- a/d2compiler/compile_test.go +++ b/d2compiler/compile_test.go @@ -1522,38 +1522,38 @@ dst.id <-> src.dst_id }, }, { - name: "root_orientation", + name: "root_direction", - text: `orientation: horizontal`, + text: `direction: right`, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "horizontal", g.Root.Attributes.Orientation.Value) + diff.AssertStringEq(t, "right", g.Root.Attributes.Direction.Value) }, }, { - name: "default_orientation", + name: "default_direction", text: `x`, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "vertical", g.Objects[0].Attributes.Orientation.Value) + diff.AssertStringEq(t, "down", g.Objects[0].Attributes.Direction.Value) }, }, { - name: "set_orientation", + name: "set_direction", text: `x: { - orientation: horizontal + direction: left }`, assertions: func(t *testing.T, g *d2graph.Graph) { - diff.AssertStringEq(t, "horizontal", g.Objects[0].Attributes.Orientation.Value) + diff.AssertStringEq(t, "left", g.Objects[0].Attributes.Direction.Value) }, }, { - name: "invalid_orientation", + name: "invalid_direction", text: `x: { - orientation: diagonal + direction: diagonal }`, - expErr: `d2/testdata/d2compiler/TestCompile/invalid_orientation.d2:2:16: expected "horizontal" or "vertical" orientation, got "diagonal" + expErr: `d2/testdata/d2compiler/TestCompile/invalid_direction.d2:2:14: direction must be one of up, down, right, left, got "diagonal" `, }, } diff --git a/d2graph/d2graph.go b/d2graph/d2graph.go index a2261686e..8aabce71b 100644 --- a/d2graph/d2graph.go +++ b/d2graph/d2graph.go @@ -98,7 +98,7 @@ type Attributes struct { // TODO: default to ShapeRectangle instead of empty string Shape Scalar `json:"shape"` - Orientation Scalar `json:"orientation"` + Direction Scalar `json:"direction"` } // TODO references at the root scope should have their Scope set to root graph AST @@ -444,8 +444,8 @@ func (obj *Object) newObject(id string) *Object { Label: Scalar{ Value: idval, }, - Orientation: Scalar{ - Value: "vertical", + Direction: Scalar{ + Value: "down", }, }, @@ -1052,17 +1052,17 @@ func Key(k *d2ast.KeyPath) []string { } var ReservedKeywords = map[string]struct{}{ - "label": {}, - "desc": {}, - "shape": {}, - "icon": {}, - "constraint": {}, - "tooltip": {}, - "link": {}, - "near": {}, - "width": {}, - "height": {}, - "orientation": {}, + "label": {}, + "desc": {}, + "shape": {}, + "icon": {}, + "constraint": {}, + "tooltip": {}, + "link": {}, + "near": {}, + "width": {}, + "height": {}, + "direction": {}, } // ReservedKeywordHolders are reserved keywords that are meaningless on its own and exist solely to hold a set of reserved keywords diff --git a/d2layouts/d2dagrelayout/layout.go b/d2layouts/d2dagrelayout/layout.go index 1edc17f1e..9fa88ccc3 100644 --- a/d2layouts/d2dagrelayout/layout.go +++ b/d2layouts/d2dagrelayout/layout.go @@ -64,10 +64,16 @@ func Layout(ctx context.Context, d2graph *d2graph.Graph) (err error) { ranksep: 100, edgesep: 40, nodesep: 60, - rankdir: "TB", } - if d2graph.Root.Attributes.Orientation.Value == "horizontal" { + switch d2graph.Root.Attributes.Direction.Value { + case "down": + rootAttrs.rankdir = "TB" + case "right": rootAttrs.rankdir = "LR" + case "left": + rootAttrs.rankdir = "RL" + case "up": + rootAttrs.rankdir = "BT" } configJS := setGraphAttrs(rootAttrs) if _, err := v8ctx.RunScript(configJS, "config.js"); err != nil { diff --git a/d2layouts/d2elklayout/layout.go b/d2layouts/d2elklayout/layout.go index 209a73856..984531314 100644 --- a/d2layouts/d2elklayout/layout.go +++ b/d2layouts/d2elklayout/layout.go @@ -120,11 +120,17 @@ func Layout(ctx context.Context, g *d2graph.Graph) (err error) { HierarchyHandling: "INCLUDE_CHILDREN", NodeSpacing: 100.0, EdgeNodeSpacing: 50.0, - Direction: "DOWN", }, } - if g.Root.Attributes.Orientation.Value == "horizontal" { + switch g.Root.Attributes.Direction.Value { + case "down": + elkGraph.LayoutOptions.Direction = "DOWN" + case "up": + elkGraph.LayoutOptions.Direction = "UP" + case "right": elkGraph.LayoutOptions.Direction = "RIGHT" + case "left": + elkGraph.LayoutOptions.Direction = "LEFT" } elkNodes := make(map[*d2graph.Object]*ELKNode) diff --git a/e2etests/stable_test.go b/e2etests/stable_test.go index 16c43f434..bbacc94b4 100644 --- a/e2etests/stable_test.go +++ b/e2etests/stable_test.go @@ -989,14 +989,14 @@ c -> solution: we get `, }, { - name: "orientation", + name: "direction", script: `a -> b -> c -> d -> e b: { - orientation: horizontal + direction: right 1 -> 2 -> 3 -> 4 -> 5 2: { - orientation: vertical + direction: up a -> b -> c -> d -> e } } diff --git a/e2etests/testdata/sanity/1_to_2/elk/board.exp.json b/e2etests/testdata/sanity/1_to_2/elk/board.exp.json index 6c709942a..c1d27b8de 100644 --- a/e2etests/testdata/sanity/1_to_2/elk/board.exp.json +++ b/e2etests/testdata/sanity/1_to_2/elk/board.exp.json @@ -5,8 +5,8 @@ "id": "a", "type": "", "pos": { - "x": 31, - "y": 12 + "x": 12, + "y": 33 }, "width": 113, "height": 126, @@ -43,8 +43,8 @@ "id": "b", "type": "", "pos": { - "x": 12, - "y": 238 + "x": 225, + "y": 12 }, "width": 113, "height": 126, @@ -81,8 +81,8 @@ "id": "c", "type": "", "pos": { - "x": 145, - "y": 238 + "x": 225, + "y": 158 }, "width": 113, "height": 126, @@ -143,12 +143,12 @@ "labelPercentage": 0, "route": [ { - "x": 68.5, - "y": 138 + "x": 125, + "y": 75 }, { - "x": 68.5, - "y": 238 + "x": 225, + "y": 75 } ], "animated": false, @@ -181,20 +181,20 @@ "labelPercentage": 0, "route": [ { - "x": 106.16666666666667, - "y": 138 + "x": 125, + "y": 117 }, { - "x": 106.16666666666667, - "y": 188 + "x": 175, + "y": 117 }, { - "x": 201.5, - "y": 188 + "x": 175, + "y": 221 }, { - "x": 201.5, - "y": 238 + "x": 225, + "y": 221 } ], "animated": false, diff --git a/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg b/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg index c6a7e3671..76640f7f2 100644 --- a/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg +++ b/e2etests/testdata/sanity/1_to_2/elk/sketch.exp.svg @@ -2,7 +2,7 @@ // RegisterHash registers a function that returns a new instance of the given // hash function. This is intended to be called from the init function in // packages that implement hash functions. func RegisterHash(h Hash, f func() hash.Hash) { @@ -22,7 +22,7 @@ width="955" height="818" viewBox="-88 -88 955 818">        panic("crypto: RegisterHash of unknown hash function")     }     hashes[h] = f -}xy acfbdhg agdfbhec abcdefghijklmnopq finallyatreeandnodessomemoremanythenhereyouhavehierarchyanotherofnestingtreesatreeinsidehierarchyroot bacde21345abcde \ No newline at end of file diff --git a/e2etests/testdata/stable/direction/elk/board.exp.json b/e2etests/testdata/stable/direction/elk/board.exp.json new file mode 100644 index 000000000..a6a3230e0 --- /dev/null +++ b/e2etests/testdata/stable/direction/elk/board.exp.json @@ -0,0 +1,1033 @@ +{ + "name": "", + "shapes": [ + { + "id": "b", + "type": "", + "pos": { + "x": 225, + "y": 12 + }, + "width": 1478, + "height": 426, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#E3E9FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 28, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 18, + "labelHeight": 41, + "labelPosition": "INSIDE_TOP_CENTER" + }, + { + "id": "b.2", + "type": "", + "pos": { + "x": 432, + "y": 87 + }, + "width": 796, + "height": 276, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "2", + "fontSize": 24, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 16, + "labelHeight": 36, + "labelPosition": "INSIDE_TOP_CENTER" + }, + { + "id": "a", + "type": "", + "pos": { + "x": 12, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "c", + "type": "", + "pos": { + "x": 1803, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "d", + "type": "", + "pos": { + "x": 2016, + "y": 162 + }, + "width": 114, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 14, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "e", + "type": "", + "pos": { + "x": 2230, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 1, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.1", + "type": "", + "pos": { + "x": 300, + "y": 162 + }, + "width": 112, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "1", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 12, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.3", + "type": "", + "pos": { + "x": 1248, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "3", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.4", + "type": "", + "pos": { + "x": 1381, + "y": 162 + }, + "width": 114, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "4", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 14, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.5", + "type": "", + "pos": { + "x": 1515, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 2, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#EDF0FD", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "5", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.a", + "type": "", + "pos": { + "x": 507, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "a", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.b", + "type": "", + "pos": { + "x": 640, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "b", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.c", + "type": "", + "pos": { + "x": 773, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "c", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.d", + "type": "", + "pos": { + "x": 906, + "y": 162 + }, + "width": 114, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "d", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 14, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + }, + { + "id": "b.2.e", + "type": "", + "pos": { + "x": 1040, + "y": 162 + }, + "width": 113, + "height": 126, + "level": 3, + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "borderRadius": 0, + "fill": "#F7F8FE", + "stroke": "#0D32B2", + "shadow": false, + "3d": false, + "multiple": false, + "tooltip": "", + "link": "", + "icon": null, + "iconPosition": "", + "fields": null, + "methods": null, + "columns": null, + "label": "e", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#0A0F25", + "italic": false, + "bold": true, + "underline": false, + "labelWidth": 13, + "labelHeight": 26, + "labelPosition": "INSIDE_MIDDLE_CENTER" + } + ], + "connections": [ + { + "id": "(a -> b)[0]", + "src": "a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 125, + "y": 225 + }, + { + "x": 225, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(b -> c)[0]", + "src": "b", + "srcArrow": "none", + "srcLabel": "", + "dst": "c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1703, + "y": 225 + }, + { + "x": 1803, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(c -> d)[0]", + "src": "c", + "srcArrow": "none", + "srcLabel": "", + "dst": "d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1916, + "y": 225 + }, + { + "x": 2016, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "(d -> e)[0]", + "src": "d", + "srcArrow": "none", + "srcLabel": "", + "dst": "e", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 2130, + "y": 225 + }, + { + "x": 2230, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(1 -> 2)[0]", + "src": "b.1", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 412, + "y": 225 + }, + { + "x": 432, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(2 -> 3)[0]", + "src": "b.2", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.3", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1228, + "y": 225 + }, + { + "x": 1248, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(3 -> 4)[0]", + "src": "b.3", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.4", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1361, + "y": 225 + }, + { + "x": 1381, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.(4 -> 5)[0]", + "src": "b.4", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.5", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1495, + "y": 225 + }, + { + "x": 1515, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(a -> b)[0]", + "src": "b.2.a", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.b", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 620, + "y": 225 + }, + { + "x": 640, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(b -> c)[0]", + "src": "b.2.b", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.c", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 753, + "y": 225 + }, + { + "x": 773, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(c -> d)[0]", + "src": "b.2.c", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.d", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 886, + "y": 225 + }, + { + "x": 906, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + }, + { + "id": "b.2.(d -> e)[0]", + "src": "b.2.d", + "srcArrow": "none", + "srcLabel": "", + "dst": "b.2.e", + "dstArrow": "triangle", + "dstLabel": "", + "opacity": 1, + "strokeDash": 0, + "strokeWidth": 2, + "stroke": "#0D32B2", + "label": "", + "fontSize": 16, + "fontFamily": "DEFAULT", + "language": "", + "color": "#676C7E", + "italic": true, + "bold": false, + "underline": false, + "labelWidth": 0, + "labelHeight": 0, + "labelPosition": "", + "labelPercentage": 0, + "route": [ + { + "x": 1020, + "y": 225 + }, + { + "x": 1040, + "y": 225 + } + ], + "animated": false, + "tooltip": "", + "icon": null + } + ] +} diff --git a/e2etests/testdata/stable/direction/elk/sketch.exp.svg b/e2etests/testdata/stable/direction/elk/sketch.exp.svg new file mode 100644 index 000000000..49447fa1b --- /dev/null +++ b/e2etests/testdata/stable/direction/elk/sketch.exp.svg @@ -0,0 +1,24 @@ + +bacde21345abcde \ No newline at end of file diff --git a/e2etests/testdata/stable/font_colors/elk/board.exp.json b/e2etests/testdata/stable/font_colors/elk/board.exp.json index 41a5119ca..0c8ebea65 100644 --- a/e2etests/testdata/stable/font_colors/elk/board.exp.json +++ b/e2etests/testdata/stable/font_colors/elk/board.exp.json @@ -43,8 +43,8 @@ "id": "beta", "type": "", "pos": { - "x": 17, - "y": 359 + "x": 409, + "y": 12 }, "width": 136, "height": 126, @@ -105,12 +105,12 @@ "labelPercentage": 0, "route": [ { - "x": 84.5, - "y": 138 + "x": 157, + "y": 75 }, { - "x": 84.5, - "y": 359 + "x": 409, + "y": 75 } ], "animated": false, diff --git a/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg b/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg index d851b1a03..a69bb2a09 100644 --- a/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg +++ b/e2etests/testdata/stable/font_colors/elk/sketch.exp.svg @@ -2,7 +2,7 @@ usersid +int +name +string +email +string +password +string +last_login +datetime +productsid +int +price +decimal +sku +string +name +string +ordersid +int +user_id +int +product_id +int +shipmentsid +int +order_id int -order_id -int -tracking_number +tracking_number +string +status string -status -string - rectanglesquare acbl1l2c1l2c3l2c2l3c1l3c2l4bacacbabcc1c2c3abc AKHIALFLGAMSTNAZCANVNMUTARLAMOOKTXORCOKSNEWYCTMANYRIDEMDNJPANCSCIDMTWAILINIAMIKYWIOHMNSDVAWVMENHVTNDcontainerfirstsecond - - -1->2 - - -c->2