Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
charts
Manage
Activity
Members
Labels
Plan
Wiki
Custom issue tracker
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
project
charts
Commits
35b8ef9e
Commit
35b8ef9e
authored
1 month ago
by
Nia Kathoni
Committed by
Daniel Cothran
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue
#3495124
: Rename charts.es6.js to charts.js for 5.1.x
parent
3e1b3566
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!124
Resolve #3495124 "Rename charts.es6.js to"
Pipeline
#378718
passed with warnings
1 month ago
Stage: build
Stage: validate
Stage: test
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/charts.es6.js
+0
-46
0 additions, 46 deletions
js/charts.es6.js
js/charts.js
+13
-11
13 additions, 11 deletions
js/charts.js
modules/charts_api_example/js/charts_api_example_js_override.js
+7
-4
7 additions, 4 deletions
...s/charts_api_example/js/charts_api_example_js_override.js
with
20 additions
and
61 deletions
js/charts.es6.js
deleted
100644 → 0
+
0
−
46
View file @
3e1b3566
/**
* @file
* Charts API.
*/
((
Drupal
)
=>
{
Drupal
.
Charts
=
Drupal
.
Charts
||
{};
Drupal
.
Charts
.
Configs
=
Drupal
.
Charts
.
Configs
||
[];
/**
* @typedef {class} Drupal.Charts.Contents
*/
Drupal
.
Charts
.
Contents
=
class
{
constructor
()
{
const
chartsElements
=
document
.
querySelectorAll
(
'
[data-chart]
'
);
chartsElements
.
forEach
(
function
(
el
)
{
const
id
=
el
.
getAttribute
(
'
id
'
);
Drupal
.
Charts
.
Configs
[
id
]
=
JSON
.
parse
(
el
.
getAttribute
(
'
data-chart
'
));
Drupal
.
Charts
.
Configs
[
id
].
drupalChartDivElement
=
el
;
Drupal
.
Charts
.
Configs
[
id
].
drupalChartDivId
=
id
;
});
}
initialize
(
id
)
{
const
event
=
new
CustomEvent
(
'
drupalChartsConfigsInitialization
'
,
{
detail
:
Drupal
.
Charts
.
Configs
[
id
]
});
Drupal
.
Charts
.
Configs
[
id
].
drupalChartDivElement
.
dispatchEvent
(
event
);
}
static
update
(
id
,
data
)
{
if
(
Drupal
.
Charts
.
Configs
.
hasOwnProperty
(
id
))
{
Drupal
.
Charts
.
Configs
[
id
]
=
data
;
}
}
getData
(
id
)
{
if
(
Drupal
.
Charts
.
Configs
.
hasOwnProperty
(
id
))
{
this
.
initialize
(
id
);
return
Drupal
.
Charts
.
Configs
[
id
];
}
return
{};
}
};
})(
Drupal
);
This diff is collapsed.
Click to expand it.
js/charts.js
+
13
−
11
View file @
35b8ef9e
/**
* DO NOT EDIT THIS FILE.
* See the following change record for more information,
* https://www.drupal.org/node/2815083
* @preserve
**/
* @file
* Charts API.
*/
((
Drupal
)
=>
{
(
Drupal
=>
{
Drupal
.
Charts
=
Drupal
.
Charts
||
{};
Drupal
.
Charts
.
Configs
=
Drupal
.
Charts
.
Configs
||
[];
/**
* @typedef {class} Drupal.Charts.Contents
*/
Drupal
.
Charts
.
Contents
=
class
{
constructor
()
{
const
charts
_e
lements
=
document
.
querySelectorAll
(
'
[data-chart]
'
);
charts
_e
lements
.
forEach
(
function
(
el
)
{
const
charts
E
lements
=
document
.
querySelectorAll
(
'
[data-chart]
'
);
charts
E
lements
.
forEach
(
function
(
el
)
{
const
id
=
el
.
getAttribute
(
'
id
'
);
Drupal
.
Charts
.
Configs
[
id
]
=
JSON
.
parse
(
el
.
getAttribute
(
'
data-chart
'
));
Drupal
.
Charts
.
Configs
[
id
].
drupalChartDivElement
=
el
;
...
...
@@ -21,7 +24,8 @@
initialize
(
id
)
{
const
event
=
new
CustomEvent
(
'
drupalChartsConfigsInitialization
'
,
{
detail
:
Drupal
.
Charts
.
Configs
[
id
]
detail
:
Drupal
.
Charts
.
Configs
[
id
],
bubbles
:
true
,
});
Drupal
.
Charts
.
Configs
[
id
].
drupalChartDivElement
.
dispatchEvent
(
event
);
}
...
...
@@ -37,9 +41,7 @@
this
.
initialize
(
id
);
return
Drupal
.
Charts
.
Configs
[
id
];
}
return
{};
}
};
})(
Drupal
);
This diff is collapsed.
Click to expand it.
modules/charts_api_example/js/charts_api_example_js_override.js
+
7
−
4
View file @
35b8ef9e
(
function
()
{
(
function
(
Drupal
)
{
'
use strict
'
;
Drupal
.
charts_api_example
=
Drupal
.
charts_api_example
||
{};
// PLEASE NOTE: this example is structured to work for Highcharts, but you
// do the same thing for any of the charting libraries.
...
...
@@ -7,10 +9,11 @@
return
'
The value for <b>
'
+
this
.
x
+
'
</b> is <b>
'
+
this
.
y
+
'
</b>
'
;
};
Drupal
.
behaviors
.
chartsApiExampleCharts
=
{
attach
:
function
(
context
,
settings
)
{
let
chart
c
ontainer
=
document
.
getElementById
(
'
exampleidjs
'
);
chart
c
ontainer
.
addEventListener
(
'
drupalChartsConfigsInitialization
'
,
function
(
e
)
{
let
chart
C
ontainer
=
document
.
getElementById
(
'
example
-
id
-
js
'
);
chart
C
ontainer
.
addEventListener
(
'
drupalChartsConfigsInitialization
'
,
function
(
e
)
{
let
data
=
e
.
detail
;
const
id
=
data
.
drupalChartDivId
;
// Change the background of the chart to green.
...
...
@@ -21,4 +24,4 @@
});
}
};
}());
}(
Drupal
));
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment