The ID of the Datawrapper chart, table, or map to update.
The fields to update. At least one must be supplied.
Optionaldescription?: stringThe description below the title, stored as metadata.describe.intro. An empty string clears it.
Optionalnote?: stringThe notes in the visualization's footer, stored as metadata.annotate.notes. An empty string clears them.
Optionaltitle?: stringThe visualization's headline. An empty string clears it.
Optional authentication and response settings.
OptionalapiKey?: stringThe name of the environment variable containing the API key. Defaults to "DATAWRAPPER_KEY".
OptionalreturnResponse?: booleanIf true, returns the unconsumed response without checking its status. Defaults to false.
A promise resolving to void, or to the raw Response when requested. By default, non-200 responses throw an error.
import { updateInfoDW } from "@nshiab/journalism-dataviz";
await updateInfoDW("abcde", {
title: "Sales keep rising",
description: "Monthly revenue since January 2025.",
note: "Source: company filings.",
});
Updates the title, description, and notes of a Datawrapper chart, table, or map in one API request.
Only supplied fields are updated. Omit a field or pass
undefinedto preserve its existing value; pass an empty string to clear it. At least one field must be supplied. Other chart settings are preserved by Datawrapper's partial metadata update.The API key is read from
DATAWRAPPER_KEYby default. This function updates the draft visualization; callpublishChartDW()afterward to publish the changes.