La documentación para desarrolladores está en inglés.
Tipo de tarjeta
comparison
Two or more subjects compared row by row.
Version 1 · schema comparison.v1.schema.json
Layouts
Every card type has full. Pick a layout with the element's layout attribute, render.layout, or a theme.
Fields
The fields of card.data. Values a source doesn't provide are null; new optional fields can appear within version 1.
| Field | Type | Required | Notes |
|---|---|---|---|
subjects[] | object[] | yes | |
subjects[].name | string | yes | |
subjects[].image | image | null | yes | |
subjects[].image.url | url | yes | WebKnox media URL: https://webknox.com/media/v1/<host>/<path>. Treat it as opaque. |
subjects[].image.width | integer | null | ||
subjects[].image.height | integer | null | ||
subjects[].image.credit | string | yes | |
subjects[].image.license | string | yes | |
subjects[].image.source_url | url | yes | |
subjects[].source_url | url | null | yes | |
rows[] | object[] | yes | |
rows[].label | string | yes | |
rows[].values[] | string[] | yes | One per subject, same order. |
Example
A recorded answer to “Ravens vs crows”. Open it in the Answer Lab to see every layout and style.
{
"v": 2,
"id": "ans_el59yzbu9b6gdzcw",
"matched": true,
"locale": "en",
"skill": "compare",
"confidence": 0.9,
"text": "Ravens are generally larger and heavier-billed than crows. Ravens often have wedge-shaped tails and deeper calls, while crows commonly make a familiar caw.\nSize: Generally larger (Ravens), Generally smaller (Crows)\nBill: Heavier, more curved (Ravens), Usually slimmer (Crows)\nTail: Often wedge-shaped (Ravens), Usually fan-shaped (Crows)\nCall: Deep croak (Ravens), Often a caw (Crows)",
"speech": "Ravens are generally larger and heavier-billed than crows. Ravens often have wedge-shaped tails and deeper calls, while crows commonly make a familiar caw.",
"card": {
"type": "comparison",
"version": 1,
"data": {
"subjects": [
{
"name": "Ravens",
"image": {
"url": "https://webknox.com/media/v1/thumb.wikimedia.org/wikipedia/commons/thumb/9/91/Corvus_corax_clarionensis%2C_Point_Reyes_National_Seashore.jpg/960px-Corvus_corax_clarionensis%2C_Point_Reyes_National_Seashore.jpg",
"width": 960,
"height": 640,
"credit": "Frank Schulenburg",
"license": "CC BY-SA 4.0",
"source_url": "https://commons.wikimedia.org/wiki/File:Corvus_corax_clarionensis,_Point_Reyes_National_Seashore.jpg"
},
"source_url": "https://en.wikipedia.org/wiki/Common_raven"
},
{
"name": "Crows",
"image": {
"url": "https://webknox.com/media/v1/upload.wikimedia.org/wikipedia/commons/a/a9/Corvus_corone_-near_Canford_Cliffs%2C_Poole%2C_England-8.jpg",
"width": 871,
"height": 929,
"credit": "Ian Kirk from Broadstone, Dorset, UK",
"license": "CC BY 2.0",
"source_url": "https://commons.wikimedia.org/wiki/File:Corvus_corone_-near_Canford_Cliffs,_Poole,_England-8.jpg"
},
"source_url": "https://en.wikipedia.org/wiki/Crow"
}
],
"rows": [
{
"label": "Size",
"values": [
"Generally larger",
"Generally smaller"
]
},
{
"label": "Bill",
"values": [
"Heavier, more curved",
"Usually slimmer"
]
},
{
"label": "Tail",
"values": [
"Often wedge-shaped",
"Usually fan-shaped"
]
},
{
"label": "Call",
"values": [
"Deep croak",
"Often a caw"
]
}
]
}
},
"sources": [
{
"name": "Wikimedia Commons",
"url": "https://commons.wikimedia.org",
"license": "per image"
}
],
"follow_ups": [],
"actions": [],
"usage": {
"billable": true
}
}