-
Notifications
You must be signed in to change notification settings - Fork 326
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Table Visualization and display text changes. #6382
Table Visualization and display text changes. #6382
Conversation
128590a
to
9df5145
Compare
if (content instanceof Object) { | ||
const type = content.type | ||
if (type === 'BigInt') { | ||
return BigInt(content.value) | ||
} else if (content['_display_text_']) { | ||
if (content['_display_text_']) { | ||
return content['_display_text_'] | ||
} else if (type === 'Date') { | ||
return new Date(content.year, content.month - 1, content.day) | ||
.toISOString() | ||
.substring(0, 10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMO this is so much better now that this part of the logic is handled by Enso 👍
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Index_Sub_Range.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Filter_Condition.enso
Outdated
Show resolved
Hide resolved
to_display_text self = | ||
first = self.first.to_display_text | ||
second = self.second.to_display_text | ||
if first.length + second.length < 75 then "Pair(" + first + ", " + second + ")" else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It might be nice to eventually have helpers for constructing these strings.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Massive PR. I left few comments there and elsewhere, but probably on the .java
ones deserve some attention.
...me/src/main/java/org/enso/interpreter/node/expression/builtin/text/AnyToDisplayTextNode.java
Show resolved
Hide resolved
.../main/java/org/enso/interpreter/node/expression/builtin/text/util/TypeToDisplayTextNode.java
Outdated
Show resolved
Hide resolved
.../main/java/org/enso/interpreter/node/expression/builtin/text/util/TypeToDisplayTextNode.java
Outdated
Show resolved
Hide resolved
## PRIVATE | ||
Convert to a display representation of this Index_Sub_Range. | ||
to_display_text : Text | ||
to_display_text self = case self of |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There shall be generic implementation for these types with few atoms that would fit the default needs. At least I see some pattern that could be handled in a generic way via Meta
or in the engine itself.
distribution/lib/Standard/Base/0.0.0-dev/src/Network/HTTP/HTTP_Status_Code.enso
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving table.js
21f8428
to
26e21d4
Compare
Add JSON support for Random Number Generator.
Add `to_display_text` to Interval and Index_Sub_Range.
## PRIVATE | ||
Convert to a display representation of this Span. | ||
to_display_text : Text | ||
to_display_text self = self.text |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, shouldn't we indicate that this is a Span
and not just regular Text
?
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Date_Time.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Duration.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Data/Time/Period.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/Errors/Common.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/System/File/File_Permissions.enso
Outdated
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/System/Process/Exit_Code.enso
Show resolved
Hide resolved
distribution/lib/Standard/Base/0.0.0-dev/src/System/Process/Process_Builder.enso
Show resolved
Hide resolved
@@ -1497,6 +1497,7 @@ type Table | |||
suffixing strategy. | |||
parse_to_columns : Text | Integer -> Text -> Case_Sensitivity -> Boolean -> Problem_Behavior -> Table | |||
parse_to_columns self column pattern="." case_sensitivity=Case_Sensitivity.Sensitive parse_values=True on_problems=Report_Error = | |||
_ = [column, pattern, case_sensitivity, parse_values, on_problems] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also adding this in my PR 😅
I think it would be cool to have the --warnings-as-errors
option to enable it on CI. Shall we create a ticket?
expect_column_names ["H", "1980-01-01", "1", "5.3", "True"] <| table.use_first_row_as_names | ||
c_5 = ['ZZ', [Nothing, False, True]] | ||
table = Table.new [c_0, c_00, c_1, c_2, c_3, c_4, c_5] | ||
expect_column_names ["H", "Column_1", "1980-01-01", "1", "5.3", "True", "Column_2"] table.use_first_row_as_names |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm wondering if we should actually attach some warning in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does but it also seems to error when rendering so will look at that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then we should have this test checking this warning.
- Change `UTI` to `URI`. - Adjust format for Period and Duration. - Add support for polyglot objects in `No_Such_Method` and `No_Such_Field`. Fix some of the failing tests.
...me/src/main/java/org/enso/interpreter/node/expression/builtin/text/AnyToDisplayTextNode.java
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look very good to me.
I think we should add some tests for the to_display_text
methods, especially ones doing formatting of numbers/dates/times - as these are not that trivial. We had experience of easily breaking to_display_text
when refactoring. This is really problematic as if we don't detect it, we can very easily introduce regressions into the IDE display that may be noticed too late.
I'm ok with not having tests in this PR as we want to move forward and I assume it was tested manually, but I think in that case we should plan a follow up ticket to add these tests - as we definitely want these to_display_text
to work correctly and avoid any regressions there.
- Shuffle File_Permission order. - Handle polyglot scenario for missing field and methods. - Tests for Date_Time to_display_text. - Truffle boundaries.
* develop: Passing events to sub-widgets in List Editor and refactoring of the slider component. (#6433) Revert "Cloud/desktop mode switcher (#6308)" (#6444) Widgets integrated with graph nodes (#6347) Table Visualization and display text changes. (#6382) Skip redundant compilations (#6436) Add parse extensions to Text type. #6330 (#6404) Cloud/desktop mode switcher (#6308) Replace Table should_equal with should_equal_verbose (#6405) Rollback event handling changes for the mouse (#6396) Dashboard directory interactivity (#6279) Ability to change the execution environment between design and live. (#6341) Implementation of elements adding to List Editor and a lot of internal API (#6390) Drop method exported from WASM + removing leaks. (#6365) Turn null into UnexpectedExpression when Union type is incomplete (#6415)
Pull Request Description
Standard.Database.Data.Table.parse_values
.Nothing
and empty string onuse_first_row_as_names
.Number.format
taking a simple format string andLocale
.Text.to_display_text
.to_display_text
for numbers to not include type (but also to display BigInteger as value).Noise.Generator
interface type.to_display_text
toJS_Object
.to_display_text
forDate
,Time_Of_Day
,Date_Time
,Duration
andPeriod
.to_display_text
toLocale
,Case_Sensitivity
,Encoding
,Text_Sub_Range
,Span
,Utf_16_Span
.to_display_text
toFile
,File_Permissions
,Process_Result
andExit_Code
.to_display_text
toURI
,HTTP_Status_Code
andHeader
.to_display_text
toMaybe
,Regression
,Pair
,Range
,Filter_Condition
.to_js_object
andto_display_text
toRandom_Number_Generator
.to_display_text
.BigInt
,Date
,Date_Time
andTime_Of_Day
JS based rendering as usingto_display_text
now.Adjusted Viz
Custom Values Rendering:

Nested Table:

Variable size Matrix view:

Checklist
Please ensure that the following checklist has been satisfied before submitting the PR:
Scala,
Java,
and
Rust
style guides. In case you are using a language not listed above, follow the Rust style guide.
./run ide build
.