Make table default visualisation (#10128)

Makes table the default vis type.

Before:
![image](https://github.com/enso-org/enso/assets/1720119/8a5d113a-ac06-4dd8-afdb-151cdbc149ab)

After:
![image](https://github.com/enso-org/enso/assets/1720119/d7c33cf7-355d-4517-8967-1963ff506f97)

Closes #10093
This commit is contained in:
AdRiley 2024-05-31 18:02:02 +03:00 committed by GitHub
parent 500e39810f
commit af4177e61f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 7 deletions

View File

@ -10,9 +10,13 @@ import project.Table as Table_Visualization
from project.Text import get_lazy_visualization_text_window
## PRIVATE
Specifies that the builtin JSON visualization should be used for any type,
Specifies that the builtin Table visualization should be used for any type,
unless specified otherwise.
Any.default_visualization self = Id.json
Any.default_visualization self = Id.table
## PRIVATE
Specifies that the builtin JSON visualization should be used for any JS_Objects
JS_Object.default_visualization self = Id.json
## PRIVATE
Returns a Text used to display this value in the IDE.

View File

@ -2027,7 +2027,7 @@ class RuntimeVisualizationsTest extends AnyFlatSpec with Matchers {
data
}
new String(data) shouldEqual "(Builtin 'JSON')"
new String(data) shouldEqual "(Builtin 'Table')"
val loadedLibraries = attachVisualizationResponses
.collect {

View File

@ -32,10 +32,13 @@ add_specs suite_builder = suite_builder.group "Serializable Visualization Identi
v_1.to_json.should_equal (expected "enso_dev.Visualization_Tests" "My Vis")
v_2.to_json.should_equal (expected "Standard.Base" "Other Vis")
group_builder.specify "specifies default JSON visualization for any type" <|
My_Type.Value 30 . default_visualization . should_equal Visualization.Id.json
"foobar".default_visualization.should_equal Visualization.Id.json
True.default_visualization.should_equal Visualization.Id.json
group_builder.specify "specifies default Table visualization for any type" <|
My_Type.Value 30 . default_visualization . should_equal Visualization.Id.table
"foobar".default_visualization.should_equal Visualization.Id.table
True.default_visualization.should_equal Visualization.Id.table
group_builder.specify "specifies default json visualization JS_Object type" <|
(Json.parse '{"name":"John","age":25,"email":"john@example.com"}') . default_visualization . should_equal Visualization.Id.json
group_builder.specify "specifies default Table visualization for Vector and Array type" <|
[1,2,3].default_visualization.should_equal Visualization.Id.table