Join the newly launched Discord
community for real-time discussions, peer support, and direct interaction with the Meridian team!
meridian.analysis.formatter.create_card_html
Stay organized with collections
Save and categorize content based on your preferences.
Creates a card's HTML snippet that includes given card and chart specs.
meridian
.
analysis
.
formatter
.
create_card_html
(
template_env
:
jinja2
.
Environment
,
card_spec
:
meridian
.
analysis
.
formatter
.
CardSpec
,
insights
:
str
,
chart_specs
:
(
Sequence
[
ChartSpec
|
TableSpec
]
|
None
)
=
None
,
stats_specs
:
(
Sequence
[
StatsSpec
]
|
None
)
=
None
)
->
str
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-09-05 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-05 UTC."],[[["\u003cp\u003eThis function generates HTML snippets for cards, incorporating specified card and chart details.\u003c/p\u003e\n"],["\u003cp\u003eIt utilizes a Jinja2 environment for templating.\u003c/p\u003e\n"],["\u003cp\u003eThe function can include insights, chart specifications, and statistical data specifications in the card HTML.\u003c/p\u003e\n"],["\u003cp\u003eThe inputs taken are: card specification, insights, chart specifications, stats specification and a jinja2 environment.\u003c/p\u003e\n"],["\u003cp\u003eThe function outputs an HTML formatted string.\u003c/p\u003e\n"]]],["The `create_card_html` function generates an HTML snippet for a card. It requires a Jinja2 template environment, a `CardSpec`, and insights (string). It optionally takes a sequence of `ChartSpec` or `TableSpec` objects, and a sequence of `StatsSpec` objects. The function then combines this data to produce the HTML output, representing the structured card with associated chart, table, and stat data.\n"],null,["\u003cbr /\u003e\n\n|------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/google/meridian/blob/v1.2.0/meridian/analysis/formatter.py#L209-L228) |\n\nCreates a card's HTML snippet that includes given card and chart specs. \n\n meridian.analysis.formatter.create_card_html(\n template_env: jinja2.Environment,\n card_spec: ../../../meridian/analysis/formatter/CardSpec.md,\n insights: str,\n chart_specs: (Sequence[ChartSpec | TableSpec] | None) = None,\n stats_specs: (Sequence[StatsSpec] | None) = None\n ) -\u003e str"]]