Skip to content

Commit

Permalink
docs: add static tags
Browse files Browse the repository at this point in the history
  • Loading branch information
ajmacdonald committed Jan 14, 2025
1 parent 21a63f5 commit e5a382a
Show file tree
Hide file tree
Showing 6 changed files with 1,322 additions and 1,274 deletions.
1 change: 1 addition & 0 deletions src/categories.js
Original file line number Diff line number Diff line change
Expand Up @@ -380,6 +380,7 @@ class Categories {
* @param {(Object|String)} config an object specifying the parameters (see above)
* @param {Object} api an object specifying any parameters for the trombone call
* @returns {Promise<Object>} this first returns a promise and when the promise is resolved it returns this categories object (with the loaded data included)
* @static
*/
static load(config={}, api={}) {
const categories = new Categories();
Expand Down
7 changes: 7 additions & 0 deletions src/chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class Chart {
* @param {(String|Element)} [target] An element or ID to use as the chart's target. If not specified, one will be created.
* @param {HighchartsConfig} config
* @returns {Highcharts.Chart}
* @static
*/
static create(target, config) {
[target, config] = Chart._handleTargetAndConfig(target, config);
Expand Down Expand Up @@ -184,6 +185,7 @@ class Chart {
* Add the provided data to the config as a series
* @param {Object} config
* @param {Array} data
* @static
*/
static setSeriesData(config, data) {
if (Array.isArray(data)) {
Expand All @@ -209,6 +211,7 @@ class Chart {
* @param {(String|Element)} [target] An element or ID to use as the chart's target. If not specified, one will be created.
* @param {Object} config
* @returns {Highcharts.Chart}
* @static
*/
static bar(target, config) {
[target, config] = Chart._handleTargetAndConfig(target, config);
Expand All @@ -230,6 +233,7 @@ class Chart {
* @param {(String|Element)} [target] An element or ID to use as the chart's target. If not specified, one will be created.
* @param {Object} config
* @returns {Highcharts.Chart}
* @static
*/
static column(target, config) {
[target, config] = Chart._handleTargetAndConfig(target, config);
Expand All @@ -251,6 +255,7 @@ class Chart {
* @param {(String|Element)} [target] An element or ID to use as the chart's target. If not specified, one will be created.
* @param {Object} config
* @returns {Highcharts.Chart}
* @static
*/
static line(target, config) {
[target, config] = Chart._handleTargetAndConfig(target, config);
Expand All @@ -272,6 +277,7 @@ class Chart {
* @param {(String|Element)} [target] An element or ID to use as the chart's target. If not specified, one will be created.
* @param {Object} config
* @returns {Highcharts.Chart}
* @static
*/
static scatter(target, config) {
[target, config] = Chart._handleTargetAndConfig(target, config);
Expand All @@ -292,6 +298,7 @@ class Chart {
* @param {(String|Element)} [target] An element or ID to use as the chart's target. If not specified, one will be created.
* @param {Object} config
* @returns {Spyral.NetworkGraph}
* @static
*/
static networkgraph(target, config) {
[target, config] = Chart._handleTargetAndConfig(target, config);
Expand Down
1 change: 1 addition & 0 deletions src/corpus.js
Original file line number Diff line number Diff line change
Expand Up @@ -1619,6 +1619,7 @@ class Corpus {
* @param {Object} config the Corpus config
* @param {Object} api any additional API values
* @returns {Promise<Corpus>}
* @static
*/
static load(config={}, api = {}) {
const promise = new Promise(function(resolve, reject) {
Expand Down
7 changes: 7 additions & 0 deletions src/load.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ class Load {
/**
* Set the base URL for use with the Load class
* @param {string} baseUrl
* @static
*/
static setBaseUrl(baseUrl) {
this.baseUrl = baseUrl;
Expand All @@ -19,6 +20,7 @@ class Load {
* @param {Object} config
* @param {Object} params
* @returns {JSON}
* @static
*/
static trombone(config = {}, params) {
let url = new URL(config.trombone ? config.trombone : this.baseUrl + 'trombone', window.location.origin);
Expand Down Expand Up @@ -93,6 +95,7 @@ class Load {
* @param {string} urlToFetch
* @param {Object} config
* @returns {Response}
* @static
*/
static load(urlToFetch, config) {
let url = new URL(config && config.trombone ? config.trombone : this.baseUrl + 'trombone');
Expand All @@ -114,6 +117,7 @@ class Load {
* Fetch HTML content from a URL
* @param {string} url
* @returns {Document}
* @static
*/
static html(url) {
return this.text(url).then(text => new DOMParser().parseFromString(text, 'text/html'));
Expand All @@ -123,6 +127,7 @@ class Load {
* Fetch XML content from a URL
* @param {string} url
* @returns {XMLDocument}
* @static
*/
static xml(url) {
return this.text(url).then(text => new DOMParser().parseFromString(text, 'text/xml'));
Expand All @@ -132,6 +137,7 @@ class Load {
* Fetch JSON content from a URL
* @param {string} url
* @returns {JSON}
* @static
*/
static json(url) {
return this.load(url).then(response => response.json());
Expand All @@ -141,6 +147,7 @@ class Load {
* Fetch text content from a URL
* @param {string} url
* @returns {string}
* @static
*/
static text(url) {
return this.load(url).then(response => response.text());
Expand Down
Loading

0 comments on commit e5a382a

Please sign in to comment.