PlotSet LogoPlotSet

How to Create an Interactive SVG

A step by step walkthrough for turning an SVG drawing into a clickable diagram with popups or a text panel in PlotSet.

Unos 10 minutos

You will end up with a drawing whose parts open an explanation when a reader clicks or hovers over them.

Expect about ten minutes. Most of it goes on checking that each id in your data matches an element in the drawing.

Los datos que necesitas

One row per clickable part, with the id of an element in the SVG and the text to show for it.

CSV de ejemplo
idheadingsubheadingcontentlink
steam-wandSteam wandFroths milkAngle the tip just below the surface.
porta-filterPortafilterHolds the coffeeLock it in a quarter turn.
drip-trayDrip trayCatches spillsEmpty it every day.
power-buttonPowerSwitches the machine onWait two minutes to warm up.
Notas

The id must match the id, class, name or aria-label of an element in the SVG, ignoring case.

Only the id is required. The heading falls back to the id if left blank.

A category column can recolour the matched parts and build a legend.

A reveal column names an element that stays hidden until its row is selected.

Los pasos

El camino exacto en PlotSet, desde una plantilla en blanco hasta el gráfico terminado.

  1. 01

    Open the Interactive SVG template

    From the PlotSet dashboard, start a new project and choose Interactive SVG from the Other category. It loads with an espresso machine and five numbered parts.

    El selector de plantillas de PlotSet: las categorías de gráficos en la columna izquierda, la cuadrícula Bar Charts abierta y la tarjeta de la plantilla Bar Chart con su botón Select visible.
    Todas las guías empiezan aquí. Elige la categoría y luego la plantilla. Es la misma cuadrícula sea cual sea el tipo de gráfico que busques.
  2. 02

    Add your drawing

    Open the SVG tab and give a URL or paste your SVG markup. Choose how the drawing fits, sizes and aligns inside the chart.

  3. 03

    Add your data

    Import a CSV or .xlsx file, paste rows from a spreadsheet, or connect a Google Sheet. Each row is one part of the drawing.

    La vista de datos del editor de PlotSet: una hoja de cálculo con las columnas Name, Value y Region llenas de cifras de provincias canadienses, junto al panel Data, que ofrece subida de CSV, Magic Import y sincronización con Google Sheet.
    La vista de datos, aquí en un proyecto de gráfico de barras. Sube un CSV, saca los números de una imagen con Magic Import o sincroniza una Google Sheet. El panel es el mismo en todos los tipos de gráfico.
  4. 04

    Bind the columns

    Choose the id column, then the heading, subheading and content columns. Add a category or a link column if you have them.

    El panel de datos de PlotSet con las asignaciones de columnas resaltadas: Label/time apuntando a la columna A, Values a la columna B y Filter/color a la columna C, con el botón Auto Binding debajo.
    Las asignaciones deciden qué columna se convierte en la etiqueta, cuál aporta los valores y cuál define el color. Auto Binding las deduce de tus encabezados, así que revísalas en lugar de darlas por buenas.
  5. 05

    Choose click or hover

    In the Interaction tab, pick the trigger, how unselected parts fade, and whether a click follows the row's link.

    El editor de PlotSet en la pestaña Preview: un gráfico de tipo Interactive SVG ya terminado en el lienzo y, a la derecha, el panel de ajustes rodeado por un recuadro rojo.
    La pestaña Preview de un gráfico de tipo Interactive SVG. Todos los controles de estilo están en el panel enmarcado: apariencia, encabezado, pie de página y las opciones propias de este tipo de gráfico, cada grupo en su propia pestaña.
  6. 06

    Pick a popup or a panel

    The Popup content and Text panel tabs set where the details appear and how they are styled.

  7. 07

    Check it on a phone

    The Mobile tab sets whether readers see the drawing, the text or both below a set width.

  8. 08

    Publish and embed

    Publish for a live chart and copy the embed code from the Share dialog. Click every part once before you share it.

    La barra de herramientas del editor de PlotSet con el botón Share resaltado, justo al lado del botón Export.
    Share es lo que convierte un gráfico terminado en un enlace público y un código de incrustación.

Empieza con la plantilla de Interactive SVG, que ya trae datos de ejemplo cargados, y sustitúyelos por los tuyos.

Abrir la plantilla

Publícalo, incrústalo o expórtalo

El último tramo es igual en todos los tipos de gráfico: Share convierte el gráfico en un enlace público en vivo y un código de incrustación, y Export lo guarda como un archivo estático.

Share: enlace público y código de incrustación

Al activar el código de incrustación y el enlace público, el gráfico queda publicado. El enlace se lo puedes enviar a cualquiera sin problema, y el código de incrustación se coloca en cualquier página como un iframe que conserva los tooltips al pasar el cursor y toda la interactividad. Si editas el gráfico más adelante, haz clic en Recreate para llevar esos cambios a ambos.

La barra de herramientas del editor de PlotSet con el botón Share resaltado, justo al lado del botón Export.
Share es lo que convierte un gráfico terminado en un enlace público y un código de incrustación.
El diálogo Share de PlotSet: el interruptor que activa el código de incrustación y el enlace público, los botones Link, Embed, Facebook, Reddit, Twitter, LinkedIn y Email, y el enlace público del gráfico con un botón Copy.
Activa el código de incrustación y el enlace público, y después copia el enlace o llévate el iframe. Recreate envía las ediciones posteriores a todos los que ya lo tengan.

Export: SVG, PNG o JPG

Export guarda una copia estática en el tamaño que necesites. El SVG se mantiene nítido a cualquier escala y se puede seguir editando en una herramienta de diseño; PNG y JPG son la opción segura para diapositivas y documentos. El multiplicador de escala es lo que te da una imagen nítida en una pantalla retina.

La barra de herramientas del editor de PlotSet con el botón Export resaltado.
Export es el camino hacia un archivo estático para una diapositiva o un informe.
El diálogo Export chart de PlotSet: un selector de escala en 2x, los campos de ancho y alto fijados en 1000 por 600, y el menú de formato abierto con SVG, PNG y JPG.
El SVG se mantiene nítido a cualquier tamaño y se puede seguir editando en una herramienta de diseño; PNG y JPG son la apuesta segura para una presentación. Ajusta la escala antes de exportar para que la imagen se vea nítida en una pantalla retina.

Consejos de estilo para un Interactive SVG

Name your layers

Give each part of the drawing a clear id in your design tool before you export the SVG.

Keep text short

Two or three lines per part read well in a popup and fit the panel.

Number the parts

Markers with numbers show readers where to click and give the text an order.

Dim what is not covered

Fading the parts with no row keeps the eye on what is interactive.

Errores comunes al hacer un Interactive SVG

A part does not respond

Its id does not match an element in the SVG. Compare the spelling with the layer name.

The drawing does not load

The URL is blocked or missing cross-origin headers. Paste the markup instead.

The panel text is cut off

The panel does not scroll. Shorten the text or switch to popups.

Nothing happens on a phone

Hover does not exist on touch screens. Switch the trigger to click.

Aprende más sobre el Interactive SVG

¿No estás seguro de que el Interactive SVG sea la opción correcta? Descubre qué es, cuándo usarlo y cuándo no.

Sobre el Interactive SVG

Interactive SVG: preguntas frecuentes

Yes. Export it as SVG with the layer names kept as ids, then paste the markup or link to it.

Crea tu Interactive SVG ahora

Gratis para empezar con más de 300 plantillas. No se necesita tarjeta de crédito.