8000 feat(widgets) Add StatsWidget by ibgreen-openai · Pull Request #9623 · visgl/deck.gl · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(widgets) Add StatsWidget #9623

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

Merged
merged 4 commits into from
May 9, 2025
Merged

feat(widgets) Add StatsWidget #9623

merged 4 commits into from
May 9, 2025

Conversation

ibgreen-openai
Copy link
Collaborator

Closes #

Background

  • Make it easy to show a probe.gl stats object
  • Both deck and luma provides these, and apps can define their own.

stats-widget

Change List

@coveralls
Copy link
coveralls commented May 8, 2025

Coverage Status

coverage: 91.634%. remained the same
when pulling 2ae79c4 on ib/stats-widget
into d000516 on master.

Comment on lines 194 to 173
mask-image: var(
--icon-camera,
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="black"><path d="M480-320v-100q0-25 17.5-42.5T540-480h100v60H540v100h-60Zm60 240q-25 0-42.5-17.5T480-140v-100h60v100h100v60H540Zm280-240v-100H720v-60h100q25 0 42.5 17.5T880-420v100h-60ZM720-80v-60h100v-100h60v100q0 25-17.5 42.5T820-80H720Zm111-480h-83q-26-88-99-144t-169-56q-117 0-198.5 81.5T200-480q0 72 32.5 132t87.5 98v-110h80v240H160v-80h94q-62-50-98-122.5T120-480q0-75 28.5-140.5t77-114q48.5-48.5 114-77T480-840q129 0 226.5 79.5T831-560Z"/></svg>')
);
-webkit-mask-image: var(
--icon-camera,
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="black"><path d="M480-320v-100q0-25 17.5-42.5T540-480h100v60H540v100h-60Zm60 240q-25 0-42.5-17.5T480-140v-100h60v100h100v60H540Zm280-240v-100H720v-60h100q25 0 42.5 17.5T880-420v100h-60ZM720-80v-60h100v-100h60v100q0 25-17.5 42.5T820-80H720Zm111-480h-83q-26-88-99-144t-169-56q-117 0-198.5 81.5T200-480q0 72 32.5 132t87.5 98v-110h80v240H160v-80h94q-62-50-98-122.5T120-480q0-75 28.5-140.5t77-114q48.5-48.5 114-77T480-840q129 0 226.5 79.5T831-560Z"/></svg>')
);
}

mask-image: var(--icon-camera,
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="black"><path d="M480-320v-100q0-25 17.5-42.5T540-480h100v60H540v100h-60Zm60 240q-25 0-42.5-17.5T480-140v-100h60v100h100v60H540Zm280-240v-100H720v-60h100q25 0 42.5 17.5T880-420v100h-60ZM720-80v-60h100v-100h60v100q0 25-17.5 42.5T820-80H720Zm111-480h-83q-26-88-99-144t-169-56q-117 0-198.5 81.5T200-480q0 72 32.5 132t87.5 98v-110h80v240H160v-80h94q-62-50-98-122.5T120-480q0-75 28.5-140.5t77-114q48.5-48.5 114-77T480-840q129 0 226.5 79.5T831-560Z"/></svg>'));
-webkit-mask-image: var(--icon-camera,
url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 -960 960 960" fill="black"><path d="M480-320v-100q0-25 17.5-42.5T540-480h100v60H540v100h-60Zm60 240q-25 0-42.5-17.5T480-140v-100h60v100h100v60H540Zm280-240v-100H720v-60h100q25 0 42.5 17.5T880-420v100h-60ZM720-80v-60h100v-100h60v100q0 25-17.5 42.5T820-80H720Zm111-480h-83q-26-88-99-144t-169-56q-117 0-198.5 81.5T200-480q0 72 32.5 132t87.5 98v-110h80v240H160v-80h94q-62-50-98-122.5T120-480q0-75 28.5-140.5t77-114q48.5-48.5 114-77T480-840q129 0 226.5 79.5T831-560Z"/></svg>'));
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

The old format is clearer - what's the change from? If we're standardizing on a linter, we should discuss that separately from adding a new widget

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, reverted... my new editor probably did this, and we don't seem to have CSS formatting in place.

Could be useful to add, now that we are starting to do serious work with stylesheets.

Comment on lines +221 to +232
font-family:
'SF Mono',
/* macOS */
'Menlo',
/* macOS */
'Consolas',
/* Windows */
'DejaVu Sans Mono',
/* Linux */
'Liberation Mono',
/* Linux */
monospace;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess we could have these but it seems a little excessive to have multiple options per OS

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

seems a little excessive to have multiple options per OS

  • This seemed to be the recommended approach when I searched. I am not sure how the availability of these has evolved over time and browsers.
  • My goal was to get a bit more interesting fonts without actually pulling in some big font blob in the CSS, and this is not a lot of styling compared to an import.

Comment on lines 69 to 75
// if (props.formatters) {
// for (const name in props.formatters) {
// const f = props.formatters[name];
// this._formatters[name] =
// typeof f === 'string' ? DEFAULT_FORMATTERS[f] || DEFAULT_COUNT_FORMATTER : f;
// }
// }
Copy link
Collaborator

Choose a reason for hiding this comment

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

Delete or keep?

@ibgreen-openai ibgreen-openai marked this pull request as ready for review May 9, 2025 12:33
@ibgreen ibgreen merged commit b1e4a9f into master May 9, 2025
4 checks passed
@ibgreen ibgreen deleted the ib/stats-widget branch May 9, 2025 12:34
@ibgreen-openai
Copy link
Collaborator Author

So now we can show stats easily in the UI which should be very useful for optimization and debugging.
Unfortunately it looks like our stat collection code has rusted badly, both in deck and luma. Most stats don't seem to update any more.
But that can be improved incrementally...

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.

4 participants
0