[{"data":1,"prerenderedAt":132},["ShallowReactive",2],{"$f1dru2u3fet5rl":3},{"endpoint":4,"errors":5,"groups":18},"https:\u002F\u002Fchartjuice.com\u002Fmcp",[6,7,8,9,10,11,12,13,14,15,16,17],"invalid_request","invalid_ops","unauthorized","forbidden_plan","not_found","conflict","chart_limit_reached","too_large","rate_limited","render_limit_reached","image_limit_reached","internal",[19,61,76,87,102,109],{"name":20,"tools":21},"Charts",[22,27,31,36,40,44,48,53,57],{"name":23,"title":24,"description":25,"does":26},"list_charts","List charts","The account's saved charts, most recently changed first. Returns each chart's id, name, type and the address a person opens it at. Use it to find a chart someone names, then read it with `get_chart`. Page through with `cursor`.","reads",{"name":28,"title":29,"description":30,"does":26},"get_chart","Get a chart","A chart as it is now, without its rows: its type and options, which column plays which role, the columns, the steps applied to the data, the main style settings and any warnings. Read this before editing a chart you did not make in this conversation, to get the column ids that ops use and to see what is already set. To see how the chart looks, call `render_chart`.",{"name":32,"title":33,"description":34,"does":35},"create_chart","Create a chart","Save a new chart. Start from a chart type and your own data (`type` with `data`), from a chart type with sample data (`type` alone), or from a gallery example (`example`). `ops` are applied before it is saved, so one call can make and style a chart. Columns get the ids c1, c2, c3 and so on, in the order they appear in the data, so `ops` can name them in the same call. The answer has the chart's id to use from then on, its `url` to give the person, its columns with their ids, and its warnings, which are what `lint_chart` would report. Call `render_chart` next to look at the result, and `apply_ops` to change it. If you are not sure which type suits the data, `list_chart_types` says what each is for. On the Free plan this is refused with `chart_limit_reached` once the account has its limit of saved charts.","changes",{"name":37,"title":38,"description":39,"does":35},"apply_ops","Edit a chart","Change a chart with ops, the same edits the editor makes: its type, which columns it charts, steps such as sort and top N, titles, axes, colors, and the data itself. `get_op_catalog` lists every op and its fields: read it once before the first edit. The ops apply together or not at all; if one is wrong the answer is `invalid_ops` with what to fix, and the chart is unchanged. Returns the chart's warnings after the change, which are what `lint_chart` would report, so there is no need to call that as well. Use column ids (c1, c2), not column names: `create_chart` answers with them, and `get_chart` has them for any chart. Afterwards call `render_chart` to check how the chart looks.",{"name":41,"title":42,"description":43,"does":35},"rename_chart","Rename a chart","Change a chart's name in My charts. The title drawn on the chart is separate: change that with the `setTitle` op.",{"name":45,"title":46,"description":47,"does":35},"duplicate_chart","Duplicate a chart","Save a copy of a chart, named \"Copy of\" and the original's name. Use it to try another design without changing the original. The copy counts toward the Free plan's saved charts like any other chart.",{"name":49,"title":50,"description":51,"does":52},"delete_chart","Delete a chart","Delete a chart for good. There is no undo, so use it only when the person asked for that chart to be deleted.","deletes",{"name":54,"title":55,"description":56,"does":26},"lint_chart","Check a chart","Readability problems with a chart as it is now: too many slices, colors too faint to see, an axis that misleads. An empty list means none were found. `create_chart`, `apply_ops` and `set_data` already answer with the same list as `warnings`, so call this for a chart you have not just changed. Fix a `warn` with `apply_ops`. An `info` is a suggestion: leave it when it is about something the person asked for, such as a color they chose. A pie reads best with 6 slices or fewer: a `topN` step with `n` set to 5 keeps the five largest and adds the rest up as a sixth.",{"name":58,"title":59,"description":60,"does":26},"render_chart","Render a chart","A saved chart as a PNG image, at 1 or 2 times its size, so you can see what the person will see. Look at it after creating or editing a chart: check that the labels fit, the colors can be told apart and the chart says what it should. The warnings that `create_chart` and `apply_ops` answer with cover the problems that are easy to miss by eye; for a chart you have not just changed, `lint_chart` gives them. Counts toward the daily renders. With `data`, the chart is drawn with that data in place of its own, in the same design: the saved chart is a template and is not changed, and the image counts toward the month's image renders instead, once for each different picture. On the Free plan the image carries a small chartjuice.com mark, as downloads from the editor do.",{"name":62,"tools":63},"Data",[64,68,72],{"name":65,"title":66,"description":67,"does":35},"set_data","Replace the data","Replace a chart's data with CSV, TSV or JSON rows, read the way a pasted or uploaded file is (header row, numbers and dates detected). Use it to show new numbers in a chart that is already designed. If the new data has the columns the chart had, by name, the chart keeps its roles, steps and colors. If the columns are different, roles are picked again: read the chart with `get_chart` to see what it charts now.",{"name":69,"title":70,"description":71,"does":26},"describe_data","Describe the data","A summary of each column the chart is drawn from, after its steps: numbers get their lowest, highest and average; text and dates get their most common values. Use it to understand data you haven't seen. For the rows themselves, use `query_data`.",{"name":73,"title":74,"description":75,"does":26},"query_data","Query the data","Rows of the chart's data after its steps, with extra steps of your own if you like (they are tried, not saved). Use it to check what a sort, filter or total would give before adding it with `apply_ops`.",{"name":77,"tools":78},"Images",[79,83],{"name":80,"title":81,"description":82,"does":26},"render_image","Render a chart from data","A PNG of a chart drawn from a chart type and data you give, with nothing saved to the account. Use it when the person wants a picture and not a chart to keep or edit; to make a chart they can open later, use `create_chart`. `ops` style it before it is drawn. Counts toward the month's image renders, once for each different picture: 100 on the Free plan and 1,000 on Pro. On the Free plan the image carries a small chartjuice.com mark.",{"name":84,"title":85,"description":86,"does":35},"create_image_url","Create an image link","A link that shows a saved chart as an image to anyone who has it, with no key and no sign-in: for an `\u003Cimg>` tag in an email, a doc, a dashboard or another site's page. The link is a live image. It shows the chart as it is now and changes when the chart is edited, so the picture in the email stays current. With `data`, the link draws the chart with that data in place of its own. The link is signed, so nobody can change it to show another chart. It works until its signing key is rotated or revoked on the account page, or for `expires_in` seconds if you give that. The link is for the site it was made on. Making a link costs nothing. Its picture counts toward the month's image renders once each time the chart changes, and once at the start of each month, however many people open it. On the Free plan the image carries a small chartjuice.com mark.",{"name":88,"tools":89},"Brand palette",[90,94,98],{"name":91,"title":92,"description":93,"does":26},"get_brand_palette","Get the brand palette","The account's saved brand palette: the colors it uses for its own charts. `null` when none is saved. Apply it to a chart with the `setPalette` op.",{"name":95,"title":96,"description":97,"does":35},"set_brand_palette","Set the brand palette","Save the account's brand palette, replacing the one it had, or clear it with `null`. Saving a palette needs the Pro plan (`forbidden_plan` otherwise).",{"name":99,"title":100,"description":101,"does":26},"extract_brand_palette","Get colors from a website","The brand colors a website uses, read from its page and stylesheets. Nothing is saved: look at the colors, then save the ones you want with `set_brand_palette`. Needs the Pro plan, and an account can look up 20 websites a day.",{"name":103,"tools":104},"Account",[105],{"name":106,"title":107,"description":108,"does":26},"get_account","Get the account","The plan, how many charts are saved against the plan's limit, and what is left of the request, render and image allowances. Check it before making many charts or images, and to explain a `chart_limit_reached`, `render_limit_reached` or `image_limit_reached` refusal.",{"name":110,"tools":111},"Reference",[112,116,120,124,128],{"name":113,"title":114,"description":115,"does":26},"list_chart_types","List chart types","Every chart type: what it is for, the data it needs (one column per role), and a short guide to its options. Read it to choose a chart for some data, then make it with `create_chart`.",{"name":117,"title":118,"description":119,"does":26},"list_examples","List examples","The gallery of example charts, each with sample data and a finished design. Pass an id as `example` to `create_chart` to start from one.",{"name":121,"title":122,"description":123,"does":26},"list_palettes","List palettes","The preset color palettes. Apply one to a chart with the `setPalette` op and its colors.",{"name":125,"title":126,"description":127,"does":26},"get_op_catalog","Get the op catalog","Every op `apply_ops` takes, with its fields: as a compact text reference, and as a JSON Schema per op. Read it once before editing charts.",{"name":129,"title":130,"description":131,"does":26},"lookup_docs","Look up the docs","Search Chartjuice's reference: which chart suits what, how to shape data for each chart, palettes, number formats, plans and limits. Use it when unsure, before guessing.",1791741570926]