← All posts

What embedded charting changes in data tools

A new charting plugin for Datasette points to a broader design issue for data systems. If you put charts close to queries, you need tighter thinking on aggregation, performance, and access control, especially in blockchain and AI operations.

Practitioners building internal data tools often hit the same wall. Query results are easy. Useful visuals are not. Teams end up exporting CSV files into spreadsheets or wiring a separate frontend onto a database query layer. This adds delay, more moving parts, and more room for mistakes.

Simon Willison recently wrote about datasette-charts 0.3a0, a plugin for Datasette. The useful fact here is simple: a query tool is gaining first-party chart rendering. The larger point sits beyond one plugin release. If you expose data through a thin layer, charting becomes part of your system design, not a cosmetic step at the end.

This matters if you build analytics around blockchain nodes, L2 sequencer logs, AI inference traces, fraud-review queues, or Go services with operational telemetry. Once charts sit close to the query engine, you need to think harder about query shape, caching, access control, and what a visual hides.

Put the chart next to the query, not above it

A common failure mode in data products is a split architecture. SQL lives in one place. Charts live in another. A frontend transforms the data again, often with its own grouping, sorting, or timezone logic. The chart looks right until a user compares it with a raw query and sees two different answers.

Keeping chart configuration close to the query reduces this drift. You want one place to define:

  • the source query
  • grouping rules
  • null handling
  • time bucket boundaries
  • sort order
  • label formatting

This is especially important for blockchain and AI operations data. A chart of failed JSON-RPC calls by minute sounds trivial. It is not. Do you bucket by request start time or end time. Do retries count once or many times. Do internal health checks belong in the same series as customer traffic.

For smart-contract monitoring, the same issue appears with event logs. A chart of bridge deposits per hour depends on whether you count transactions, emitted events, unique senders, or settled receipts after reorg safety. If the query and chart layer drift apart, your dashboard becomes an argument instead of an instrument.

When you inspect a charting setup, start with the SQL or equivalent query object. The visual is the last step. The main risk sits upstream.

Inspect aggregation rules before you trust a trend line

Charts compress detail. This is useful. It is also where bad assumptions hide.

Look at the aggregation first. In practice, you should check four things.

1. Bucket width

A five-minute bucket and a one-hour bucket tell different stories. Short buckets show burstiness. Long buckets hide retries, failed batches, and short outages.

For AI systems, token throughput per minute might show saturation during peak prompts. Per hour, the same graph looks flat. For blockchain indexers, per-block and per-minute charts differ during chain stalls or delayed block propagation.

2. Time basis

Use one time basis and state it. UTC is often the least bad choice. Problems start when ingestion time, event time, and display time mix in one chart.

If you chart mempool arrival time for one panel and confirmed block inclusion time for another, comparisons become noisy. For model-serving logs, request receipt time and response completion time serve different operational questions.

3. Missing data treatment

Zero and null are different. A missing metric scrape is not the same as zero activity. In a blockchain monitoring chart, a missing RPC poll during a node restart should not look like a healthy idle period.

4. Cardinality collapse

Many chart layers silently group small categories into “other” or drop long tails. This helps legibility, but it can hide the exact outlier you need. One unusual contract method selector or one model route with high latency often matters more than the top five normal ones.

A quick test helps. Export the data behind the chart and compare row counts, bucket counts, and totals with the displayed series. If they differ, find where the transformation happened.

Design for repeatable queries, or your dashboard will fight your database

The moment you embed charts into a query interface, load patterns change. Users stop running one query at a time. They refresh dashboards, share saved views, and stack multiple panels on the same table. A small internal tool turns into a read-heavy system.

This is where many teams go wrong. They treat visual analytics as a presentation problem when it is a workload problem.

For Go services backing these systems, a few design choices matter early:

  • Precompute expensive aggregates on a schedule.
  • Keep raw event tables append-only where possible.
  • Add indexes for the exact filter and group-by paths users hit.
  • Cache stable chart queries with clear expiry rules.
  • Separate operational dashboards from ad hoc exploration workloads.

In blockchain systems, this often means maintaining summary tables for:

  • transactions by chain and minute
  • failed calls by upstream provider
  • contract events by topic and block range
  • bridge settlement lag percentiles
  • reorg counts by day

In AI systems, useful summaries include:

  • requests by model and minute
  • latency percentiles by route
  • token input and output totals by customer tier
  • tool-call error rates by provider
  • prompt-injection detection hits by source

You do not need a large warehouse for this. You do need discipline around query cost. A chart which scans a full event log every refresh will work in testing and fail in production.

If you expose SQLite through Datasette or a similar thin layer, the constraints are sharper. This is fine. It forces good habits. Materialized slices, scheduled denormalization, and index review matter more than visual polish.

Access control belongs in the data path, not the chart widget

Embedded charts often create a false sense of safety. Teams think of them as read-only, then forget that a chart is still a projection of underlying data. If the query behind it exposes sensitive rows, the chart inherits the problem.

For AI and blockchain operations, the sensitive fields are not always obvious. Examples include:

  • wallet addresses tied to customer accounts
  • prompt content with user data
  • internal model routing labels
  • provider API error payloads
  • fraud-review annotations
  • infrastructure hostnames or tenant IDs

The safe pattern is simple. Restrict data before visualization. Do not fetch broad datasets and rely on frontend filtering or hidden columns.

When you review a chart-enabled query layer, verify:

  • who is allowed to run the base query
  • whether saved queries inherit row-level restrictions
  • whether exported CSV or JSON output matches chart permissions
  • whether filters expose hidden dimensions through counts
  • whether drill-down links reveal raw records a viewer should not see

This issue appears often in bridge monitoring and exchange-adjacent systems. A chart of deposits by hour seems harmless, until clicking a bar reveals addresses or transaction hashes tied to an account review case. The problem is not the chart. The problem is access control defined too late.

Read charts as operational signals, not proof

A chart is a compact signal. Treat it as a pointer for investigation.

This matters in security and abuse work. Suppose you chart failed smart-contract calls by function selector and see a sudden spike. That does not prove an exploit attempt. It points you toward traces, calldata patterns, sender clustering, recent deployments, and upstream RPC health.

The same discipline applies to AI safety telemetry. A rise in prompt-injection detections does not tell you whether the source is one abusive client, a broken classifier threshold, or a new crawler path through your app.

A useful dashboard pairs each chart with a clear drill path:

  1. chart
  2. query definition
  3. sampled raw rows
  4. related logs or traces
  5. runbook for investigation

If you stop at step one, you build a display wall. If you support the full path, you build an operational tool.

This is one reason thin data apps are useful. They keep the distance between signal and source short. A practitioner should be able to move from a suspicious bar on a chart to the underlying records in one or two steps.

What to watch next

Charting inside query tools will keep spreading. The useful question is not which library wins. It is whether your data layer stays truthful once visuals become the default interface.

Watch for three things in your own systems. First, whether chart definitions and query logic live together. Second, whether repeated dashboard reads push you into precomputation. Third, whether every chart has a safe, controlled path back to raw evidence. Teams that handle those three points tend to get more value from lightweight analytics stacks, with fewer silent errors.