Hey there! This week, I’ve been elbow-deep in code, tinkering and tailoring to bring you some significant updates. Here's a rundown:
New Table Component
I've put together a table component that’s as functional as it is visually appealing. It supports pagination and fetches each page dynamically, making your navigation smooth. And the cherry on top? You can now embed complex HTML within any cell, making your data display as rich as you need it to be. The styling is in sync with the design framework we discussed earlier, ensuring a sleek look and feel.
Here’s a sneak peek:
A keen eye will notice me re-using the button components from earlier. The “13 Results” component is new as well — called a “Badge,” and you’ll likely see it again elsewhere.
New Bar Chart Component
With the help of a nifty library called Chartist, I've crafted a bar chart component that’s rendered using SVGs, ensuring crisp visualizations. The styling process was straightforward, and the result is something I’m really excited about. Below is an example of a stacked bar chart you can now utilize:
The title, key, and labels are all customizable when I create the chart, and it’ll automatically expand to take up the whole width of the element I’ve placed it into.
Coming up next, I’ll be adding line and pie charts to the mix, giving you a fuller spectrum of options to visualize your data. The goal is to provide a suite of intuitive, easy-to-use charting tools that will help you glean insights from your numbers at a glance.
Backend Boost with the HyperLogLog Extension
To support these charts and analytics from in the database, I've integrated a HyperLogLog extension to our Postgres setup. This is a game-changer for counting unique elements like daily unique customers or orders. Traditional approaches like using the count(*)
function from Postgres could have you twiddling your thumbs as it churns through millions of rows in complex queries, sometimes taking minutes to return results. Alternative methods like pre-computing counts daily are often brittle and high-maintenance, and external data warehouses like Snowflake paired with Looker can easily cost 6-figures or more (and still take seconds to return results!).
HyperLogLog swoops in to save the day by offering a way to get count estimates nearly instantly, regardless of how many items we’re counting! Unlike the count(*)
approach which returns an exact count, HyperLogLog is probabilitstic and can only estimate the true count. However the estimates are quite accurate—they’ll be within ~1.5% of the actual count. The trade-off is well worthwhile considering the massive reduction in query time, maintainence complexity, and cost!
This week’s progress marks a significant stride towards making Pinkbird’s platform more robust and user-friendly. There's more in store, and I can't wait to share the upcoming developments with you. Stay tuned for more updates!
Weekly Wine Recommendation
Sip on Lillet Blanc Vermouth Apéritif, a light, citrusy escape once graced by James Bond on screen. Ideal to ease out of work mode or spark a vibrant weekend brunch. Cheers!