Skip to content
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

Scatterplot fixes and improvements #11898

Merged
merged 13 commits into from
Jan 3, 2025
Merged

Scatterplot fixes and improvements #11898

merged 13 commits into from
Jan 3, 2025

Conversation

marthasharkey
Copy link
Contributor

@marthasharkey marthasharkey commented Dec 17, 2024

Pull Request Description

  • fixes color bug
  • allows 'colour' to be recognised as color
  • removes the label dropdown when not multiseries plot

image
colour-color

Checklist

Please ensure that the following checklist has been satisfied before submitting the PR:

  • The documentation has been updated, if necessary.
  • Screenshots/screencasts have been attached, if there are any visual changes. For interactive or animated visual changes, a screencast is preferred.
  • All code follows the
    Scala,
    Java,
    TypeScript,
    and
    Rust
    style guides. In case you are using a language not listed above, follow the Rust style guide.
  • Unit tests have been written where possible.
  • If meaningful changes were made to logic or tests affecting Enso Cloud integration in the libraries,
    or the Snowflake database integration, a run of the Extra Tests has been scheduled.
    • If applicable, it is suggested to paste a link to a successful run of the Extra Tests.

Copy link

github-actions bot commented Dec 17, 2024

🧪 Storybook is successfully deployed!

📊 Dashboard:

@marthasharkey marthasharkey changed the title fix colour bug Scatterplot fixes and improvements Dec 18, 2024
Comment on lines 54 to 55
## PRIVATE
Colour
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like having both constructors Color and Colour is quite confusing. Which one should I use? Are they equivalent? Looking at the code below:

        Point_Data.Color ->
            colour_col = Point_Data.Colour.lookup_in table

before I noticed there's 2 different constructors I was pretty sure this was a typo (once Color and once Colour). It's so so easy to confuse the two.

Wouldn't it be much cleaner to keep a single constructor but modify the lookup/fallback mechanism to accept columns with both names? E.g. we can keep only the Color constructor but allow it to detect columns named color as well as colour. I would very much prefer such solution if possible.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I agree it isn't clear, I'll look into how we can see if it will detect both!

Comment on lines 97 to 100
Point_Data.Color ->
colour_col = table.lookup_ignore_case "Colour"
is_good c = (self.is_recognized c).not
if is_good colour_col then colour_col else Error.throw Nothing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks much better.

Btw. not directly related to this change but I see that in this method, if the column is not found, we sometimes throw Nothing and sometimes throw No_Fallback_Column. Signature suggests No_Fallback_Column, so if possible would be good to get this consistent (although tbh it's not that important as long as it doesn't break anything since it's just internal code - still would be good to make it clearer if possible).

Copy link
Member

@radeusgd radeusgd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enso part looks good to me, the tests are great.

const textSelectionButton = createTextSelectionButton()
return computed(() => [
{
icon: 'select' as Icon,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as is not necessary here--there are typesafe ways to prevent the typechecker from widening these icon properties to strings. One approach would be to declare the return type, e.g. computed<ToolbarItem[]>(...)

@marthasharkey marthasharkey added CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge labels Jan 3, 2025
@mergify mergify bot merged commit 1f77195 into develop Jan 3, 2025
56 of 57 checks passed
@mergify mergify bot deleted the wip/mk/scatterplot-fix branch January 3, 2025 16:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI: No changelog needed Do not require a changelog entry for this PR. CI: Ready to merge This PR is eligible for automatic merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scatterplot fixes and improvements
5 participants