Identifica la familia de cálculo. Conserva el valor literal al construir el objeto de datos.
Ejemplo de uso
import type { ChartData } from '@neural-charts/web';
export const dataHeader = {
type: 'contour',
} satisfies Pick<ChartData, 'type'>;Isolíneas de un campo escalar medido sobre una rejilla bidimensional.
@neural-charts/webcontourAncho del contenedor
La gráfica se adapta automáticamente al espacio disponible. Elige un ancho para simular otro contenedor.
Compara 49 muestras de origen con la rejilla de mayor resolución del ejemplo básico.
| Serie | id | x | y | value | unit | Visible |
|---|---|---|---|---|---|---|
| temperature | sensor-0-0 | 0 | 0 | 10 | °C | Sí |
| temperature | sensor-0-1 | 2 | 0 | 11 | °C | Sí |
| temperature | sensor-0-2 | 4 | 0 | 13 | °C | Sí |
| temperature | sensor-0-3 | 6 | 0 | 14 | °C | Sí |
| temperature | sensor-0-4 | 8 | 0 | 13 | °C | Sí |
| temperature | sensor-0-5 | 10 | 0 | 11 | °C | Sí |
| temperature | sensor-0-6 | 12 | 0 | 10 | °C | Sí |
| temperature | sensor-1-0 | 0 | 2 | 11 | °C | Sí |
| temperature | sensor-1-1 | 2 | 2 | 14 | °C | Sí |
| temperature | sensor-1-2 | 4 | 2 | 18 | °C | Sí |
| temperature | sensor-1-3 | 6 | 2 | 20 | °C | Sí |
| temperature | sensor-1-4 | 8 | 2 | 18 | °C | Sí |
| temperature | sensor-1-5 | 10 | 2 | 14 | °C | Sí |
| temperature | sensor-1-6 | 12 | 2 | 11 | °C | Sí |
| temperature | sensor-2-0 | 0 | 4 | 13 | °C | Sí |
| temperature | sensor-2-1 | 2 | 4 | 18 | °C | Sí |
| temperature | sensor-2-2 | 4 | 4 | 23 | °C | Sí |
| temperature | sensor-2-3 | 6 | 4 | 26 | °C | Sí |
| temperature | sensor-2-4 | 8 | 4 | 23 | °C | Sí |
| temperature | sensor-2-5 | 10 | 4 | 18 | °C | Sí |
| temperature | sensor-2-6 | 12 | 4 | 13 | °C | Sí |
| temperature | sensor-3-0 | 0 | 6 | 14 | °C | Sí |
| temperature | sensor-3-1 | 2 | 6 | 20 | °C | Sí |
| temperature | sensor-3-2 | 4 | 6 | 26 | °C | Sí |
| temperature | sensor-3-3 | 6 | 6 | 30 | °C | Sí |
| temperature | sensor-3-4 | 8 | 6 | 26 | °C | Sí |
| temperature | sensor-3-5 | 10 | 6 | 20 | °C | Sí |
| temperature | sensor-3-6 | 12 | 6 | 14 | °C | Sí |
| temperature | sensor-4-0 | 0 | 8 | 13 | °C | Sí |
| temperature | sensor-4-1 | 2 | 8 | 18 | °C | Sí |
| temperature | sensor-4-2 | 4 | 8 | 23 | °C | Sí |
| temperature | sensor-4-3 | 6 | 8 | 26 | °C | Sí |
| temperature | sensor-4-4 | 8 | 8 | 23 | °C | Sí |
| temperature | sensor-4-5 | 10 | 8 | 18 | °C | Sí |
| temperature | sensor-4-6 | 12 | 8 | 13 | °C | Sí |
| temperature | sensor-5-0 | 0 | 10 | 11 | °C | Sí |
| temperature | sensor-5-1 | 2 | 10 | 14 | °C | Sí |
| temperature | sensor-5-2 | 4 | 10 | 18 | °C | Sí |
| temperature | sensor-5-3 | 6 | 10 | 20 | °C | Sí |
| temperature | sensor-5-4 | 8 | 10 | 18 | °C | Sí |
| temperature | sensor-5-5 | 10 | 10 | 14 | °C | Sí |
| temperature | sensor-5-6 | 12 | 10 | 11 | °C | Sí |
| temperature | sensor-6-0 | 0 | 12 | 10 | °C | Sí |
| temperature | sensor-6-1 | 2 | 12 | 11 | °C | Sí |
| temperature | sensor-6-2 | 4 | 12 | 13 | °C | Sí |
| temperature | sensor-6-3 | 6 | 12 | 14 | °C | Sí |
| temperature | sensor-6-4 | 8 | 12 | 13 | °C | Sí |
| temperature | sensor-6-5 | 10 | 12 | 11 | °C | Sí |
| temperature | sensor-6-6 | 12 | 12 | 10 | °C | Sí |
Toca un dato o explóralo con el puntero o el teclado.
Ajusta la presentación y la interacción de este ejemplo.
En series densas se limita el número de etiquetas. Los valores originales están en la tabla.
Abre una gráfica para explorar sus datos, probar las opciones y copiar su código.
Úsalas para comparar valores escalares iguales sobre un campo numérico. La separación de líneas respeta las coordenadas originales; no implica una proyección geográfica.
Abre cada propiedad para saber cuándo usarla, consultar su tipo público y ver ejemplos donde proceda.
La propiedad data.type para esta familia es contour.
Identifica la familia de cálculo. Conserva el valor literal al construir el objeto de datos.
import type { ChartData } from '@neural-charts/web';
export const dataHeader = {
type: 'contour',
} satisfies Pick<ChartData, 'type'>;Declara cómo se interpretan los valores de cada eje. Las categorías tienen IDs; las fechas se representan en milisegundos UTC.
import type { ChartData } from '@neural-charts/web';
export const axes = {
"x": {
"type": "linear",
"unit": "m"
},
"y": {
"type": "linear",
"unit": "m"
}
} satisfies (ChartData & { type: 'contour' })['axes'];export type Signature = {
readonly x: Omit<
Readonly<{
type: 'linear';
domain?: readonly [number, number];
reversed?: boolean;
nice?: boolean;
includeZero?: boolean;
unit?: string;
}>,
'title' | 'labels' | 'grid'
> & {
readonly title?: never;
readonly grid?: never;
readonly labels?: never;
};
readonly y: Omit<
Readonly<{
type: 'linear';
domain?: readonly [number, number];
reversed?: boolean;
nice?: boolean;
includeZero?: boolean;
unit?: string;
}>,
'title' | 'labels' | 'grid'
> & {
readonly title?: never;
readonly grid?: never;
readonly labels?: never;
};
};Define la cuadrícula de muestras que usa Contour para interpolar los niveles.
export type Signature = {
readonly id: string;
readonly x: readonly number[];
readonly y: readonly number[];
readonly ids: readonly string[];
readonly values: readonly (number | null)[];
readonly unit?: string | undefined;
} & { readonly color?: never; readonly datum?: never };Personaliza la presentación sin cambiar la identidad de las series ni de los puntos.
Aplica una paleta por orden de serie.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"colors": [
"#2559CC",
"#B52E70"
]
}
};Identifica una serie por ID y personaliza su color, trazo, patrón o marcador. markerFill, markerStroke y markerStrokeWidth ajustan el relleno y el borde del marcador.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"series": [
{
"id": "visits",
"color": "#2559CC",
"marker": "diamond"
}
]
}
};Ajusta el grosor de los trazos de datos en píxeles.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"lineWidth": 3
}
};Muestra valores junto a las marcas en las familias compatibles.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"dataLabels": true
}
};Limita cuántas etiquetas de valor considera el renderer al colocarlas.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"labelLimit": 12
}
};Elige cómo resolver la densidad de etiquetas: automática, todas o truncadas.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"dataLabelLayout": "auto"
}
};Configura alineación, color hexadecimal, tamaño y peso del título. Se aplica también a SVG y PNG.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"titleStyle": {
"fontSize": 24,
"align": "left"
}
}
};Aplica los mismos controles de texto a la descripción visible debajo del título.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"descriptionStyle": {
"color": "#405573"
}
}
};Fija el ancho mínimo del área de datos entre 0 y 1600 px. En contenedores estrechos, se desplaza la gráfica y se mantienen fijos el título y la leyenda. La exportación incluye toda la gráfica.
Valor inicial 0 px
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"appearance": {
"minPlotWidth": 580
}
};Define los umbrales para dibujar líneas de igual valor en Contour. Cada nivel puede incluir nombre y color.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions<'contour'> = {
"layout": {
"levels": [
{
"id": "cool",
"value": 14,
"name": "14°C",
"color": "#2E73CF"
},
{
"id": "mild",
"value": 18,
"name": "18°C",
"color": "#638A35"
},
{
"id": "warm",
"value": 22,
"name": "22°C",
"color": "#A46BE0"
},
{
"id": "hot",
"value": 26,
"name": "26°C",
"color": "#D68D21"
}
],
"segmentBudget": 4096
}
};Limita la cantidad de segmentos que puede generar Contour. Úsalo para acotar la complejidad de la salida.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions<'contour'> = {
"layout": {
"levels": [
{
"id": "cool",
"value": 14,
"name": "14°C",
"color": "#2E73CF"
},
{
"id": "mild",
"value": 18,
"name": "18°C",
"color": "#638A35"
},
{
"id": "warm",
"value": 22,
"name": "22°C",
"color": "#A46BE0"
},
{
"id": "hot",
"value": 26,
"name": "26°C",
"color": "#D68D21"
}
],
"segmentBudget": 4096
}
};Los tipos y dominios de datos determinan la escala. Usa options.axes para ajustar su presentación.
Controla la cuadrícula. En cada eje puedes ajustar visibilidad, marcas y etiquetas.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"axes": {
"grid": true
}
};Configura la presentación del eje X. El tipo de datos del eje se declara en data.axes.x.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"axes": {
"x": {
"title": "Day"
}
}
};Configura la presentación del eje principal de valores, incluido su formato numérico.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"axes": {
"y": {
"title": "Revenue",
"numberFormat": {
"style": "currency",
"currency": "EUR"
}
}
}
};Controla si se muestra la leyenda cuando el gráfico tiene entradas.
Valor inicial Visible
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"legend": {
"visible": true
}
};Ubica la leyenda. Las posiciones laterales requieren al menos 600 px de ancho; por debajo se muestra en la parte inferior.
Valor inicial bottom
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"legend": {
"position": "bottom"
}
};Permite mostrar u ocultar series desde la leyenda.
Valor inicial Activa
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"legend": {
"interactive": true
}
};Invierte el orden visual de las entradas de la leyenda y conserva el orden de las series en el gráfico.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"legend": {
"reverse": true
}
};Limita la longitud del texto visible de cada entrada de la leyenda.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"legend": {
"maxLabelCharacters": 24
}
};Ajusta la separación entre las entradas de la leyenda.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"legend": {
"itemSpacing": 12
}
};Controla el detalle que aparece al explorar una observación.
Valor inicial Activo
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"enabled": true
}
};Muestra una observación o compara series en la misma posición cuando es compatible.
Valor inicial point
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"content": "shared"
}
};Coloca el tooltip dentro del área de trazado. docked prefiere debajo del dato si cabe.
Valor inicial auto
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"placement": "docked"
}
};Dibuja una guía en gráficas cartesianas compatibles.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"crosshair": true
}
};Permite fijar el detalle mientras se siguen explorando otras observaciones.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"pinnable": true
}
};Configura el fondo del tooltip con un color hexadecimal.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"background": "#17243A"
}
};Configura el texto del tooltip con un color hexadecimal. Elige un contraste suficiente frente al fondo.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"tooltip": {
"foreground": "#FFFFFF"
}
};Identifica la selección y las series ocultas por sus IDs.
Aplica una ventana de dominio y configura controles de zoom en gráficas compatibles.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"viewport": {
"axes": "x",
"controls": true,
"pan": true,
"wheel": "ctrl"
}
};import type { PlanViewportValue } from '@neural-charts/core';
import type { ChartZoomOptions } from '@neural-charts/web';
export type Signature =
| Readonly<{
axes: 'x' | 'y' | 'xy';
value?: PlanViewportValue;
controls?: boolean;
zoom?: Readonly<ChartZoomOptions>;
pan?: boolean;
pinch?: boolean;
wheel?: false | 'ctrl' | 'always';
}>
| undefined;Controla la visibilidad por ID de serie. Un array vacío deja todas las series visibles.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"hiddenSeriesIds": [
"previous"
]
};Aplica la selección por identidad de serie y observación.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"selectedPoints": [
{
"seriesId": "visits",
"pointId": "day-0"
}
]
};export type Signature =
readonly Readonly<{ seriesId: string; pointId: string }>[] | undefined;Activa la entrada y las transiciones que ofrece el renderer. Respeta la preferencia de movimiento reducido.
Valor inicial Desactivada
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"animation": {
"enabled": true
}
};Indica la duración en milisegundos. Cero aplica el resultado inmediatamente.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"animation": {
"duration": 250
}
};Cambia la revisión para solicitar otra reproducción de la animación.
import type { ChartOptions } from '@neural-charts/web';
export const options: ChartOptions = {
"animation": {
"revision": 2
}
};import type { ChartOptions } from '@neural-charts/web';
export const options = {
"title": "Rejilla de 7 × 7",
"description": "Compara 49 muestras de origen con la rejilla de mayor resolución del ejemplo básico.",
"height": 380,
"layout": {
"levels": [
{
"id": "cool",
"value": 14,
"name": "14°C",
"color": "#2E73CF"
},
{
"id": "mild",
"value": 18,
"name": "18°C",
"color": "#638A35"
},
{
"id": "warm",
"value": 22,
"name": "22°C",
"color": "#A46BE0"
},
{
"id": "hot",
"value": 26,
"name": "26°C",
"color": "#D68D21"
}
],
"segmentBudget": 4096
},
"appearance": {
"colors": [
"#2E73CF",
"#638A35",
"#A46BE0",
"#D68D21"
],
"markers": false,
"dataLabels": false,
"lineWidth": 2,
"markerRadius": 6
},
"legend": {
"visible": true,
"position": "bottom"
},
"tooltip": {
"enabled": true,
"content": "point",
"placement": "auto",
"crosshair": false
},
"axes": {
"grid": true,
"x": {
"visible": true,
"title": "Distancia X (m)"
},
"y": {
"visible": true,
"title": "Distancia Y (m)"
}
}
} satisfies ChartOptions;Puedes seleccionar una observación con el puntero o entrar al gráfico con Tab. Las flechas recorren los datos; Inicio y Fin buscan los extremos. Enter o Espacio seleccionan y Escape cierra el detalle.
La tabla del gráfico conserva los valores originales, también los ausentes y los de series ocultas. Una etiqueta repetida no combina categorías distintas. La revisión manual con lectores de pantalla sigue pendiente.
Guía de accesibilidadCopia el objeto de entrada actual con sus identificadores y valores originales.