{"id":3474,"library":"dvc-render","title":"DVC Render","description":"dvc-render is a Python library for rendering data stored in DVC plots format into various output formats, such as Vega. It also supports generating HTML and Markdown reports containing multiple plots. It is used internally by DVC, DVCLive, and DVC Studio. The current version is 1.0.2, with frequent patch and minor releases.","status":"active","version":"1.0.2","language":"en","source_language":"en","source_url":"https://github.com/iterative/dvc-render","tags":["dvc","data-versioning","mlops","plotting","visualization","reporting","data-science"],"install":[{"cmd":"pip install dvc-render","lang":"bash","label":"Install dvc-render"}],"dependencies":[],"imports":[{"symbol":"VegaRenderer","correct":"from dvc_render import VegaRenderer"},{"symbol":"render_html","correct":"from dvc_render import render_html"}],"quickstart":{"code":"from dvc_render import VegaRenderer, render_html\n\nproperties = {\"template\": \"confusion\", \"x\": \"predicted\", \"y\": \"actual\"}\ndatapoints = [\n    {\"predicted\": \"B\", \"actual\": \"A\"},\n    {\"predicted\": \"A\", \"actual\": \"A\"},\n    {\"predicted\": \"B\", \"actual\": \"B\"},\n]\n\n# Create a renderer for a single plot\nrenderer = VegaRenderer(datapoints, \"my_confusion_plot\", **properties)\n\n# Get the Vega-Lite JSON specification\nplot_content = renderer.get_filled_template()\nprint(\"Generated Vega-Lite:\", plot_content[:100], \"...\") # Print first 100 chars\n\n# Generate an HTML report with the plot\nrender_html([renderer], \"report.html\")\nprint(\"Generated report.html\")","lang":"python","description":"This example demonstrates how to create a VegaRenderer instance for a confusion matrix, retrieve its filled Vega-Lite template, and then generate a simple HTML report containing the plot."},"warnings":[{"fix":"Review and update plot definitions in `dvc.yaml` to conform to the new 1.0+ standards. Consult DVC documentation for `dvc plots`.","message":"The 1.0.0 release standardized `plots` across DVC, Studio, and VS Code. Users with custom plot configurations defined for DVC versions prior to 1.0.0 may experience breaking changes or require updates to their `dvc.yaml` definitions.","severity":"breaking","affected_versions":"<1.0.0"},{"fix":"Thoroughly test custom templates. Refer to DVC's official plot template documentation for best practices and supported structures. Ensure `dvc-render` is up to date to benefit from parsing improvements.","message":"Using custom plot templates can be complex. Earlier versions (0.5.x, 0.7.0) had multiple fixes related to correctly parsing recursive dictionary structures, handling lists, and finding data anchors within custom templates. Ensure your custom templates strictly adhere to DVC's expected `dvc plots` schema to avoid rendering issues.","severity":"gotcha","affected_versions":"<1.0.2"},{"fix":"Understand DVC's plot definitions and data format expectations before using `dvc-render` for custom rendering solutions. Consider using DVCLive to automatically log data in a compatible format.","message":"dvc-render is designed to work with data in 'DVC plots format'. While the library can be used independently, its full utility and intended use cases are deeply integrated with the DVC ecosystem. Users expecting a generic, standalone plotting library might find it less flexible without the context of a DVC project.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-11T00:00:00.000Z","next_check":"2026-07-10T00:00:00.000Z"}