Skip to content

Commit a180fb0

Browse files
committed
Minor changes to option names
2 parents b8d0a01 + 773f393 commit a180fb0

File tree

5 files changed

+76
-11
lines changed

5 files changed

+76
-11
lines changed

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,54 @@
11
/nbproject/
22
/node_modules/
3+
4+
### JetBrains IDEs ###
5+
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
6+
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
7+
8+
# User-specific stuff:
9+
.idea/workspace.xml
10+
.idea/tasks.xml
11+
12+
# Sensitive or high-churn files:
13+
.idea/dataSources.ids
14+
.idea/dataSources.xml
15+
.idea/dataSources.local.xml
16+
.idea/sqlDataSources.xml
17+
.idea/dynamic.xml
18+
.idea/uiDesigner.xml
19+
20+
# Gradle:
21+
.idea/gradle.xml
22+
.idea/libraries
23+
24+
# Mongo Explorer plugin:
25+
.idea/mongoSettings.xml
26+
27+
## File-based project format:
28+
*.iws
29+
30+
## Plugin-specific files:
31+
32+
# IntelliJ
33+
/out/
34+
35+
# mpeltonen/sbt-idea plugin
36+
.idea_modules/
37+
38+
# JIRA plugin
39+
atlassian-ide-plugin.xml
40+
41+
# Crashlytics plugin (for Android Studio and IntelliJ)
42+
com_crashlytics_export_strings.xml
43+
crashlytics.properties
44+
crashlytics-build.properties
45+
fabric.properties
46+
47+
### WebStorm Patch ###
48+
# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721
49+
50+
# *.iml
51+
# modules.xml
52+
# .idea/misc.xml
53+
# *.ipr
54+
.idea/

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ cpuGauge.setValueAnimated(90, 1);
7272
| ```max``` | The maximum value for the gauge (```100```) |
7373
| ```label``` | Optional function that returns a string label that will be rendered in the center. This function will be passed the current value |
7474
| ```showValue``` | Whether to show the value at the center of the gauge (```true```) |
75+
| ```gaugeClass``` | The CSS class of the gauge (```gauge```) |
76+
| ```dialClass``` | The CSS class of the gauge's dial (```dial```) |
77+
| ```valueDialClass``` | The CSS class of the gauge's fill (value dial) (```value```) |
78+
| ```valueTextClass``` | The CSS class of the gauge's text (```value-text```) |
79+
7580

7681

7782

dist/gauge.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
valueLabelRender = typeof (opts.label) === "function" ? opts.label : defaultLabelRenderer,
173173
startAngle = typeof (opts.dialStartAngle) === "undefined" ? 135 : opts.dialStartAngle,
174174
endAngle = typeof (opts.dialEndAngle) === "undefined" ? 45 : opts.dialEndAngle,
175+
valueDialClass = typeof (opts.valueDialClass) === "undefined" ? 'value' : opts.valueDialClass,
176+
valueTextClass = typeof (opts.valueTextClass) === "undefined" ? 'value-text' : opts.valueTextClass,
177+
dialClass = typeof (opts.dialClass) === "undefined" ? 'dial' : opts.dialClass,
178+
gaugeClass = typeof (opts.gaugeClass) === "undefined" ? 'gauge' : opts.gaugeClass,
175179
gaugeTextElem,
176180
gaugeValuePath,
177181
instance;
@@ -194,7 +198,7 @@
194198

195199
function initializeGauge(elem) {
196200
gaugeTextElem = svg("text", {
197-
"class": "value-text",
201+
"class": valueTextClass,
198202
"x": 500,
199203
"y": 550,
200204
"font-size": "700%",
@@ -203,7 +207,7 @@
203207
"text-anchor": "middle"
204208
});
205209
gaugeValuePath = svg("path", {
206-
"class": "value",
210+
"class": valueDialClass,
207211
"fill": "transparent",
208212
"stroke": "#666",
209213
"stroke-width": 25,
@@ -212,10 +216,10 @@
212216

213217
var angle = getAngle(100, 360 - Math.abs(startAngle - endAngle));
214218
var flag = angle <= 180 ? 0 : 1;
215-
var gaugeElement = svg("svg", {"viewBox": "0 0 1000 1000", "class": "gauge"},
219+
var gaugeElement = svg("svg", {"viewBox": "0 0 1000 1000", "class": gaugeClass},
216220
[
217221
svg("path", {
218-
"class": "dial",
222+
"class": dialClass,
219223
"fill": "transparent",
220224
"stroke": "#eee",
221225
"stroke-width": 20,
@@ -273,4 +277,4 @@
273277
})();
274278

275279
return Gauge;
276-
});
280+
});

dist/gauge.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/gauge.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,10 @@
172172
valueLabelRender = typeof (opts.label) === "function" ? opts.label : defaultLabelRenderer,
173173
startAngle = typeof (opts.dialStartAngle) === "undefined" ? 135 : opts.dialStartAngle,
174174
endAngle = typeof (opts.dialEndAngle) === "undefined" ? 45 : opts.dialEndAngle,
175+
valueDialClass = typeof (opts.valueDialClass) === "undefined" ? 'value' : opts.valueDialClass,
176+
valueTextClass = typeof (opts.valueTextClass) === "undefined" ? 'value-text' : opts.valueTextClass,
177+
dialClass = typeof (opts.dialClass) === "undefined" ? 'dial' : opts.dialClass,
178+
gaugeClass = typeof (opts.gaugeClass) === "undefined" ? 'gauge' : opts.gaugeClass,
175179
gaugeTextElem,
176180
gaugeValuePath,
177181
instance;
@@ -194,7 +198,7 @@
194198

195199
function initializeGauge(elem) {
196200
gaugeTextElem = svg("text", {
197-
"class": "value-text",
201+
"class": valueTextClass,
198202
"x": 500,
199203
"y": 550,
200204
"font-size": "700%",
@@ -203,7 +207,7 @@
203207
"text-anchor": "middle"
204208
});
205209
gaugeValuePath = svg("path", {
206-
"class": "value",
210+
"class": valueDialClass,
207211
"fill": "transparent",
208212
"stroke": "#666",
209213
"stroke-width": 25,
@@ -212,10 +216,10 @@
212216

213217
var angle = getAngle(100, 360 - Math.abs(startAngle - endAngle));
214218
var flag = angle <= 180 ? 0 : 1;
215-
var gaugeElement = svg("svg", {"viewBox": "0 0 1000 1000", "class": "gauge"},
219+
var gaugeElement = svg("svg", {"viewBox": "0 0 1000 1000", "class": gaugeClass},
216220
[
217221
svg("path", {
218-
"class": "dial",
222+
"class": dialClass,
219223
"fill": "transparent",
220224
"stroke": "#eee",
221225
"stroke-width": 20,
@@ -273,4 +277,4 @@
273277
})();
274278

275279
return Gauge;
276-
});
280+
});

0 commit comments

Comments
 (0)