create_report
Make a report: a document people read and share — a briefing, an explainer, a research write-up, a product spec, a proposal, an investor update, a quarterly or campaign review. It is one HTML page on Artifacts' standard report look: theme.css (added for you; link it with <link rel="stylesheet" href="theme.css">) gives the title and meta line, headline numbers, figures for charts and diagrams, cards, panels, tables and the rest, as a kit you compose freely: any arrangement of pictures, charts, numbers, cards and text the content needs, with your own HTML and CSS (on its tokens) for what the kit lacks. theme picks its fonts and colors. A written report cites what it relies on in the page; a report that shows the space's numbers names them in sources (a sheet range, a database table, or another item) and draws them from window.ARTIFACTS. The page gets window.ARTIFACTS = { read_at, data: { <name>: … }, errors: { <name>: why }, sources: { <name>: { reads, title, url, note } } } before any of its scripts run. A sheet or database source is { kind, from, columns, rows (numbers as numbers), text (as people see them: "$1,234", "12%"), records (each row as an object by column) }; another item is { kind, from, content }. Draw from it in JavaScript (a chart library from a CDN, or your own SVG and tables); never type its numbers into the HTML. Read guide topic "reports" first: it has the classes, with the HTML of each block. Give the head and the first finished part; update_report adds the rest, a section a call. Run it with render_report once it is whole.
Parameters
space_idstringrequiredtitlestringrequiredsourcesobject[]Show child attributes
namestringrequirednotestringsheetstringrangestringdatabaseobjectShow child attributes
itemstringrequiredtablestringrequiredfieldsstring[]requiredgroup_bystringtotalstringsum, avg, min, max, count.filtersobject[]Show child attributes
fieldstringrequiredopstringrequiredis, is_not, contains, not_contains, gt, gte, lt, lte, empty, not_empty.valuestring | number | booleansortobject[]Show child attributes
fieldstringrequireddescbooleanlimitintegeritemstringthemestringpaper, slate, ink, forest, midnight.htmlstringrequiredfilesobject[]Show child attributes
pathstringrequiredcontentstringrequiredmessagestringread_report
A report as it is now: its files (people's live edits included; numbered: true puts line numbers in front), its version, its sources, and what each source gives the page now — columns and the first rows of a table, or the content of an item. The page gets window.ARTIFACTS = { read_at, data: { <name>: … }, errors: { <name>: why }, sources: { <name>: { reads, title, url, note } } } before any of its scripts run. A sheet or database source is { kind, from, columns, rows (numbers as numbers), text (as people see them: "$1,234", "12%"), records (each row as an object by column) }; another item is { kind, from, content }. Draw from it in JavaScript (a chart library from a CDN, or your own SVG and tables); never type its numbers into the HTML.
Parameters
item_idstringrequiredpathsstring[]numberedbooleandatabooleanupdate_report
Change a report: its files (the same edits as edit_page — replace exact text, write a whole file, delete, rename; index.html stays), its sources, its theme, or any of them. sources, when given, is the whole list in its new form: keep the ones that stay. theme restyles the whole report (its fonts and colors) without touching its HTML. To build an empty report or rewrite one: guide topic "reports" first (the standard look and the HTML of each block), then one section a call. Everyone with it open gets the new report at once; file edits become a new version with your message. read_report first (people may have edited it), render_report after.
Parameters
item_idstringrequiredmessagestringrequirededitsobject[]Show child attributes
opstringrequiredwrite, replace, delete, rename.pathstringcontentstringfindstringreplacestringallbooleantostringsourcesobject[]Show child attributes
namestringrequirednotestringsheetstringrangestringdatabaseobjectShow child attributes
itemstringrequiredtablestringrequiredfieldsstring[]requiredgroup_bystringtotalstringsum, avg, min, max, count.filtersobject[]Show child attributes
fieldstringrequiredopstringrequiredis, is_not, contains, not_contains, gt, gte, lt, lte, empty, not_empty.valuestring | number | booleansortobject[]Show child attributes
fieldstringrequireddescbooleanlimitintegeritemstringthemestringpaper, slate, ink, forest, midnight.render_report
Run a report as people see it, with its data read now, and check all of it in one call: JavaScript errors, console errors and failed requests; its layout at desktop and phone widths, in words; pictures of the whole page; sources that could not be read, and Artifacts's and whether it is on the standard look. steps clicks and types through it as in render_page. Call it once the report is built, not after every edit. Fix every error and every source that can't be read before you hand it over.
Parameters
item_idstringrequiredwidthintegerheightintegerfrom_yintegerpicturesbooleanstepsobject[]Show child attributes
clickstringtypeobjectShow child attributes
selectorstringrequiredtextstringrequiredpressstringscrollnumberwaitnumber