Skip to content

Chore: add test, demo, update readme and export(html) for table api - #1686

Open
rajnisht7 wants to merge 10 commits into
fossasia:devfrom
rajnisht7:chore-table-api
Open

Chore: add test, demo, update readme and export(html) for table api#1686
rajnisht7 wants to merge 10 commits into
fossasia:devfrom
rajnisht7:chore-table-api

Conversation

@rajnisht7

@rajnisht7 rajnisht7 commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Description

This PR adds demo, test for the table api and updates the readme also enables the export of table in html format

This PR is made on top of #1677

Motivation and Context

Adding test, demo and updating readme for table API and adding in exportHtml

How Has This Been Tested?

verified the tests by executing locally all test passed

Screenshots :

image

the pdf: visdom_table_test_2026-08-04_07-20.html

before:
image
pdf: visdom_table_test_2026-08-03_18-56.html

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Code refactor or cleanup (changes to existing code for improved readability or performance)

Checklist:

  • I adapted the version number under py/visdom/VERSION according to Semantic Versioning
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

Summary by Sourcery

Document and demonstrate the new editable table visualization API and support exporting table panes to HTML in automated tests and demos.

New Features:

  • Add README documentation for the vis.table API, including data formats, options, and event handling.
  • Add a new example demo showcasing the vis.table pane with a leaderboard-style table.
  • Enable HTML export rendering for table panes in the export template, generating tabular markup for headers and rows.

Enhancements:

  • Integrate the new table demo into the main demo environment alongside the existing HTML table example.

Tests:

  • Extend Playwright and Cypress pane tests to cover the new table demo with expected pane sizing.

Copilot AI lite review requested due to automatic review settings August 4, 2026 13:00

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@sourcery-ai

sourcery-ai Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Adds documentation, demo usage, tests, and HTML export support for the new vis.table API, and wires it into existing demo and pane regression tests with expected table dimensions.

Sequence diagram for vis.table HTML export rendering

sequenceDiagram
  actor User
  participant VisdomClient
  participant ExportTemplate
  participant DOM

  User->>VisdomClient: exportHtml
  VisdomClient->>ExportTemplate: renderContent(id, pane, pc)
  ExportTemplate->>ExportTemplate: check pane.content.__type
  alt t == table
    ExportTemplate->>ExportTemplate: read c.headers and c.rows
    ExportTemplate->>DOM: mkEl(table)
    ExportTemplate->>DOM: createTHead().insertRow()
    ExportTemplate->>DOM: createTBody()
    ExportTemplate->>DOM: insertRow() for each row
    ExportTemplate->>DOM: appendChild(tbl)
  else t != table
    ExportTemplate->>ExportTemplate: handle other pane types
  end
Loading

File-Level Changes

Change Details Files
Add README documentation for vis.table usage and event semantics.
  • Document vis.table as a basic visualization function in the function list.
  • Add a detailed vis.table section covering data formats, headers handling, numpy support, example code, opts.editable, and TableEdit event payloads.
README.md
Implement HTML export rendering for table panes.
  • Handle table pane type in export template renderContent.
  • Render a with header row from pane.content.headers and body rows from pane.content.rows, with null/undefined-safe string conversion.
  • Show a placeholder note when the table has no header data.
  • js/template/exportTemplate.js
    Add a concrete table demo alongside the existing HTML table example.
    • Introduce a new table(viz, env, args) helper that calls viz.table with sample leaderboard data.
    • Import and invoke the new table demo from the main demo runner after html_table so both appear in the demo environment.
    example/components/plot_table.py
    example/demo.py
    Extend Cypress and Playwright pane regression tests to cover the new table pane type and dimensions.
    • Register a new 'Table' basic example in Cypress tests and set expected pane height/width for that demo.
    • Add a new Table pane case in Playwright pane.spec.js with demo key 'table' and expected size for screenshot/visual regression.
    cypress/integration/pane.js
    playwright/tests/pane.spec.js

    Tips and commands

    Interacting with Sourcery

    • Trigger a new review: Comment @sourcery-ai review on the pull request.
    • Continue discussions: Reply directly to Sourcery's review comments.
    • Generate a GitHub issue from a review comment: Ask Sourcery to create an
      issue from a review comment by replying to it. You can also reply to a
      review comment with @sourcery-ai issue to create an issue from it.
    • Generate a pull request title: Write @sourcery-ai anywhere in the pull
      request title to generate a title at any time. You can also comment
      @sourcery-ai title on the pull request to (re-)generate the title at any time.
    • Generate a pull request summary: Write @sourcery-ai summary anywhere in
      the pull request body to generate a PR summary at any time exactly where you
      want it. You can also comment @sourcery-ai summary on the pull request to
      (re-)generate the summary at any time.
    • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
      request to (re-)generate the reviewer's guide at any time.
    • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
      pull request to resolve all Sourcery comments. Useful if you've already
      addressed all the comments and don't want to see them anymore.
    • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
      request to dismiss all existing Sourcery reviews. Especially useful if you
      want to start fresh with a new review - don't forget to comment
      @sourcery-ai review to trigger a new review!

    Customizing Your Experience

    Access your dashboard to:

    • Enable or disable review features such as the Sourcery-generated pull request
      summary, the reviewer's guide, and others.
    • Change the review language.
    • Add, remove or edit custom review instructions.
    • Adjust other review settings.

    Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • In the exportTemplate.js table renderer, you bail out when headers is empty even if rows has data; consider either deriving headers from the first row or rendering a headerless table so export works for data-only tables.
  • The table export currently assumes each row is an array and indexes by header position; if vis.table supports dict-style rows (as described in the README), you may want to normalize dict rows to arrays in the export path to avoid silently skipping or misordering values.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- In the exportTemplate.js table renderer, you bail out when headers is empty even if rows has data; consider either deriving headers from the first row or rendering a headerless table so export works for data-only tables.
- The table export currently assumes each row is an array and indexes by header position; if vis.table supports dict-style rows (as described in the README), you may want to normalize dict rows to arrays in the export path to avoid silently skipping or misordering values.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@rajnisht7 rajnisht7 changed the title Chore: add test, demo, update readme and export(hmtl) for table api Chore: add test, demo, update readme and export(html) for table api Aug 4, 2026
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.

2 participants