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

Dash.BigNumber #458

Closed
wants to merge 13 commits into from
Closed

Dash.BigNumber #458

wants to merge 13 commits into from

Conversation

Fil
Copy link
Contributor

@Fil Fil commented Jan 9, 2024

closes #248

Note: this version adds a secondaryTitle option, which allows to give the trend a (native) tooltip explaining what it compares to (last week, YoY, etc).

Capture d’écran 2024-01-09 à 12 40 58

typescript support is wonky (not sure how to make the two imports pass)

@Fil Fil requested review from mbostock and allisonhorst January 9, 2024 11:41
src/client/stdlib/dash/bigNumber.ts Outdated Show resolved Hide resolved
src/client/stdlib/dash/bigNumber.ts Outdated Show resolved Hide resolved
src/client/stdlib/dash/bigNumber.ts Outdated Show resolved Hide resolved
Comment on lines 36 to 37
const div = html`<div style="display: flex; flex-direction: column; font-family: var(--sans-serif);">
<div style="text-transform: uppercase; font-size: 12px;">${title}</div>
Copy link
Member

Choose a reason for hiding this comment

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

We’ll want to switch to <figure><h2>Title</h2>…</figure> here to match the behavior of Plot; we’ll then have card styles ensure that this gets displayed correctly within the grid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

related #468

src/client/stdlib/dash/bigNumber.ts Outdated Show resolved Hide resolved
if (typeof trendFormat !== "function") trendFormat = d3.format(trendFormat);
const div = html`<div style="display: flex; flex-direction: column; font-family: var(--sans-serif);">
<div style="text-transform: uppercase; font-size: 12px;">${title}</div>
<div style="display: flex; flex-wrap: wrap; column-gap: 10px; align-items: baseline;">
Copy link
Member

Choose a reason for hiding this comment

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

We’ll either need options or CSS custom properties to control:

  • column-gap: 10px;
  • font-size: 32px; font-weight: bold; line-height: 1;
  • font-size: 14px;

</div>
${plot}
</div>`;
return href == null ? div : html`<a href=${href} target=${target} style="color: inherit;">${div}</a>`;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure I want the link to cover the whole display; first, it's a bit ugly with the underline decoration; second (and more important), it might take over the click interaction set on children.

@Fil Fil force-pushed the fil/dash-bignumber branch from 3aaa14e to a6505ab Compare January 10, 2024 15:24
@Fil

This comment was marked as outdated.

@Fil
Copy link
Contributor Author

Fil commented Jan 11, 2024

I feel that most of what's left is choosing names (and capitalization) for the component, the classes (if any), the correct html tags etc. I don't have strong opinions on any of these and I would not know what guidelines to follow.

@Fil
Copy link
Contributor Author

Fil commented Jan 16, 2024

superseded by #547

@Fil Fil closed this Jan 16, 2024
@Fil Fil deleted the fil/dash-bignumber branch February 2, 2024 09:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Big number component
3 participants