Skip to content

Commit 5cf79c0

Browse files
DOCSP-25814 surfaced methods on sidebar TOC (#623)
* surfaced methods on sidebar TOC
1 parent 749e6f9 commit 5cf79c0

File tree

8 files changed

+578
-491
lines changed

8 files changed

+578
-491
lines changed

snooty.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ toc_landing_pages = ["/installation", "/dashboards",
1818
"/customize-charts/conditional-formatting",
1919
"/embed-charts-and-dashboards",
2020
"/embedding-charts",
21+
"/embedded-chart-options",
2122
"/embedding-dashboards",
23+
"/embedded-dashboard-options",
2224
"/view-export-chart-data",
2325
"/embedding-tutorials",
2426
"/embedding-charts-sdk",

source/embed-charts-and-dashboards.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ with a :ref:`charts iframe <embedding-charts-iframe>` or a
2323
:ref:`dashboards iframe <embedding-dashboards-iframe>`.
2424

2525
|charts-short| offers a :guilabel:`Getting Started` UI to help you
26-
learn how to embed charts and dashboards with an iFrame or Javascript
26+
learn how to embed charts and dashboards with an iFrame or JavaScript
2727
SDK. To learn more, see :ref:`get-started-embedding`.
2828

2929
To learn how to embed charts and dashboards in a web application, see

source/embedded-chart-options.txt

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,14 @@ The following options are available for embedded charts:
3636
- Purpose
3737

3838
* - :ref:`embedded-chart-sdk-options`
39-
- Provides the Javascript ``createChart()`` method for rendering a
40-
chart within a web page. You can control properties like the
41-
height and width of the chart.
39+
- Provides the JavaScript ``createChart()`` method for rendering a
40+
chart within a web page. You can control properties such as the
41+
height and width of the chart. To learn more, see
42+
:ref:`embedded-charts-options-table`.
4243

4344
* - :ref:`embedded-chart-iframe-options`
4445
- You can set chart options within an iframe by adding inline style
45-
tags and by adding query parameters to the chart URL.
46+
tags and query parameters to the chart URL.
4647

4748
.. _refresh-behavior:
4849

source/embedded-charts-options/embedded-sdk.txt

Lines changed: 76 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
.. _embedded-chart-sdk-options:
22
.. _sdk-option-reference:
33

4-
====================
5-
Embedded SDK Options
6-
====================
4+
===========================
5+
Embedded Charts SDK Options
6+
===========================
77

88
.. default-domain:: mongodb
99

@@ -56,12 +56,14 @@ interval and other aspects.
5656
});
5757
await chart.render(embedContainer);
5858

59+
.. _embedded-charts-options-table:
60+
5961
Embedded Chart Options
6062
----------------------
6163

6264
.. please keep these alphabetized
6365

64-
You can specify the following options for an embedded chart:
66+
The ``createChart()`` method takes the following options:
6567

6668
.. list-table::
6769
:header-rows: 1
@@ -79,7 +81,7 @@ You can specify the following options for an embedded chart:
7981
omitted, charts don't automatically refresh.
8082

8183
Use this option with the ``maxDataAge`` option to
82-
configure how often the chart refreshes.
84+
configure automatic dashboard refresh frequency.
8385
- no
8486

8587
* - ``background``
@@ -89,10 +91,10 @@ You can specify the following options for an embedded chart:
8991

9092
- A color hex code
9193
- A |css| color name
92-
- ``transparent`` for a transparent background
94+
- A transparent background using the value ``transparent``
9395

94-
If you don't provide the background the background color defaults
95-
to the current ``theme``:
96+
If omitted, the background color defaults to the current
97+
``theme``:
9698

9799
- ``#FFFFFF`` for the ``light`` theme, or
98100
- ``#21313C`` for the ``dark`` theme.
@@ -135,7 +137,7 @@ You can specify the following options for an embedded chart:
135137

136138
* - ``height``
137139
- number
138-
- Height of the chart. If you don't provide the height, the chart defaults to
140+
- Height of the chart. If omitted, the chart defaults to
139141
the height of its container. If you provide a value without units,
140142
the unit defaults to pixels (px).
141143
- no
@@ -147,6 +149,12 @@ You can specify the following options for an embedded chart:
147149
|charts| renders the chart with data from the cache if
148150
the data is less than one hour old.
149151

152+
153+
154+
If the data from the cache is more than one hour old,
155+
|charts-short| queries the data source for the latest data,
156+
refreshes the cache, and renders the chart using this data.
157+
150158
To learn how |charts| loads data from the cache when
151159
loading or refreshing the chart based on the
152160
``autoRefresh`` and ``maxDataAge`` values, see
@@ -185,9 +193,9 @@ You can specify the following options for an embedded chart:
185193
- number
186194
- Width of the chart.
187195

188-
If you don't provide the width, the chart defaults to
196+
If omitted, the chart defaults to
189197
the width of its container. If you provide a value without units,
190-
the unit defaults to pixels (px).
198+
it defaults to pixels (px).
191199
- no
192200

193201
Chart Configuration
@@ -199,69 +207,74 @@ After you create a chart, you can control the configuration
199207
of the chart by calling methods on the ``Chart`` instance returned
200208
by ``ChartsEmbedSDK.createChart({ ... })``.
201209

202-
.. list-table::
203-
:header-rows: 1
204-
:stub-columns: 1
205-
:widths: 40 60
210+
``getCustomizableAxes()``
211+
~~~~~~~~~~~~~~~~~~~~~~~~~
206212

207-
* - Method
208-
- Description
213+
Returns the chart axes for the embedded chart.
209214

210-
* - ``getCustomizableAxes()``
211-
- Returns the chart axes for the embedded chart.
215+
``setAutoRefresh(boolean)``
216+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
212217

213-
* - ``setAutoRefresh(boolean)``
214-
- Specifies whether the chart automatically refreshes. If
215-
omitted, charts don't automatically refresh.
218+
Specifies whether the chart automatically refreshes. If
219+
omitted, charts don't automatically refresh.
216220

217-
Use this method with the ``setMaxDataAge`` method to
218-
configure how often the chart refreshes.
219-
220-
* - ``setFilter(object)``
221-
- Applies a :ref:`query filter <filter-embedded-charts>`
222-
to the embedded chart or chart within an
223-
:ref:`embedded dashboard <embedding-dashboards>`. This
224-
method expects an object that contains valid query
225-
operators. Any fields referenced in this filter must be
226-
added to the :guilabel:`Allowed filter fields`
227-
list in the ``Embed Chart`` modal window.
228-
An empty document ``{}`` is equivalent to no filter.
229-
230-
See the :ref:`Embedding Tutorials
231-
<embedding-tutorials>` for
232-
more information about enabling embedding for a chart
233-
and allowing fields for filter use.
234-
235-
* - ``setMaxDataAge(number)``
236-
- Specifies the maximum age of data to load from the cache
237-
when loading or refreshing the chart. If omitted,
238-
|charts| renders the chart with data from the cache if
239-
the data is less than one hour old.
221+
Use this method with the ``setMaxDataAge`` method to
222+
configure how often the chart refreshes.
240223

241-
To learn how |charts| loads data from the cache when
242-
loading or refreshing the chart based on the
243-
``setAutoRefresh`` and ``setMaxDataAge`` values, see
244-
:ref:`refresh-behavior`.
224+
``setFilter(object)``
225+
~~~~~~~~~~~~~~~~~~~~~
226+
227+
Applies a :ref:`query filter <filter-embedded-charts>`
228+
to the embedded chart or chart within an
229+
:ref:`embedded dashboard <embedding-dashboards>`. This
230+
method takes an object with valid query
231+
operators. Any fields referenced in this filter must be
232+
added to the :guilabel:`Allowed filter fields`
233+
list in the ``Embed Chart`` modal window.
234+
An empty document ``{}`` is equivalent to no filter.
235+
236+
See the :ref:`Embedding Tutorials <embedding-tutorials>` for
237+
more information about enabling embedding for a chart
238+
and allowing fields for filter use.
239+
240+
``setMaxDataAge(number)``
241+
~~~~~~~~~~~~~~~~~~~~~~~~~
242+
243+
Specifies the maximum age of data to load from the cache
244+
when loading or refreshing the chart. If omitted,
245+
|charts| renders the chart with data from the cache if
246+
the data is less than one hour old.
247+
248+
If the data from the cache is more than one hour old,
249+
|charts-short| queries the data source for the latest data,
250+
refreshes the cache, and renders the chart using this data.
251+
252+
To learn how |charts| loads data from the cache when
253+
loading or refreshing the chart based on the
254+
``setAutoRefresh`` and ``setMaxDataAge`` values, see
255+
:ref:`refresh-behavior`.
256+
257+
``setRenderingSpecOverride(object)``
258+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
259+
260+
Specifies how to customize a chart.
245261

246-
* - ``setRenderingSpecOverride(object)``
247-
- Specifies how to customize a chart.
262+
For a list of available customizations, see
263+
:ref:`rendering-spec-options`.
248264

249-
For a list of available
250-
customizations, see :ref:`rendering-spec-options`.
265+
``setTheme("dark" | "light")``
266+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
251267

252-
* - ``setTheme("dark" | "light")``
253-
- Sets the current theme of the embedded chart. When setting the
254-
theme to ``dark``, you need to ensure that a chart's
255-
background color has appropriate contrast so that the information
256-
remains visible.
268+
Sets the current theme of the embedded chart. When setting the
269+
theme to ``dark``, you need to ensure that a chart's
270+
background color has appropriate contrast so that the information
271+
remains visible.
257272

258-
.. seealso::
273+
.. seealso::
259274

260-
- `Charts Embedding SDK API Documentation
261-
<https://www.npmjs.com/package/@mongodb-js/charts-embed-dom>`__
275+
- `Charts Embedding SDK API Documentation <https://www.npmjs.com/package/@mongodb-js/charts-embed-dom>`__
262276

263-
- `Charts Embedding SDK examples
264-
<https://github.com/mongodb-js/charts-embed-sdk/blob/master/examples>`__
277+
- `Charts Embedding SDK examples <https://github.com/mongodb-js/charts-embed-sdk/blob/master/examples>`__
265278

266279
Example
267280
~~~~~~~

source/embedded-charts-options/iframe.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ Iframe Options
1313
:class: singlecol
1414

1515
You can set chart options within an iframe by adding inline style
16-
tags and by adding query parameters to the chart URL. Inline style
16+
tags and query parameters to the chart URL. Inline style
1717
tags allow you to specify display options such as height, width,
1818
background color, and border width. Query parameters allow you to
1919
specify a refresh interval for your chart, as well as a light or

0 commit comments

Comments
 (0)