@kevinburke/flot 5.0.0 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +35 -0
- package/README.md +2 -2
- package/dist/flot.js +15 -11
- package/dist/flot.min.js +1 -1
- package/dist/flot.min.js.map +1 -1
- package/dist/flot.mjs +15 -11
- package/dist/jquery.flot.js +15 -11
- package/dist/jquery.flot.min.js +1 -1
- package/dist/jquery.flot.min.js.map +1 -1
- package/dist/plugins/jquery.flot.crosshair.js +1 -1
- package/dist/plugins/jquery.flot.image.js +1 -1
- package/dist/plugins/jquery.flot.pie.js +1 -1
- package/dist/plugins/jquery.flot.pie.min.js.map +1 -1
- package/dist/plugins/jquery.flot.resize.js +1 -1
- package/dist/plugins/jquery.flot.threshold.js +2 -2
- package/dist/plugins/jquery.flot.threshold.min.js +1 -1
- package/dist/plugins/jquery.flot.threshold.min.js.map +1 -1
- package/package.json +7 -2
- package/source/globals.d.ts +22 -0
- package/source/jquery.canvaswrapper.js +6 -6
- package/source/jquery.flot.browser.js +4 -2
- package/source/jquery.flot.composeImages.js +1 -1
- package/source/jquery.flot.js +5 -3
- package/source/jquery.flot.pie.js +1 -1
- package/source/jquery.flot.threshold.js +1 -1
- package/types/index.d.ts +580 -0
- package/types/jquery.d.ts +37 -0
- package/types/test.ts +72 -0
- package/types/tsconfig.json +15 -0
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ All notable changes to this project will be documented in this file.
|
|
|
5
5
|
Starting with 5.0.0, this changelog tracks the @kevinburke/flot fork.
|
|
6
6
|
For earlier upstream history, see the [flot/flot repository](https://github.com/flot/flot).
|
|
7
7
|
|
|
8
|
+
## [5.1.0] - 2026-04-14
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **TypeScript type definitions.** Hand-written `.d.ts` files now ship
|
|
13
|
+
with the package. `import { plot, type PlotOptions } from '@kevinburke/flot'`
|
|
14
|
+
gives full autocomplete and type-checking. The jQuery adapter types
|
|
15
|
+
augment `JQueryStatic` so `$.plot()` is also typed.
|
|
16
|
+
- Package validation via `publint` in CI.
|
|
17
|
+
- Source code type-checking via TypeScript `checkJs` mode with a
|
|
18
|
+
ratchet (`.tsc-baseline`) that enforces the error count doesn't
|
|
19
|
+
grow.
|
|
20
|
+
|
|
21
|
+
### Fixed
|
|
22
|
+
|
|
23
|
+
- `jquery.canvaswrapper.js`: replace bare `hasOwnProperty.call(...)`
|
|
24
|
+
with `Object.prototype.hasOwnProperty.call(...)`. The bare form
|
|
25
|
+
would `ReferenceError` in strict mode — a latent bug in the SVG
|
|
26
|
+
text rendering path.
|
|
27
|
+
- `jquery.flot.composeImages.js`: drop the ignored `"utf-8"` argument
|
|
28
|
+
from `new TextEncoder()`.
|
|
29
|
+
- `jquery.flot.browser.js`: cache `window.top` and null-check it
|
|
30
|
+
before accessing browser-detection properties.
|
|
31
|
+
- `jquery.flot.js`: add null guard after the `options.grid.markings`
|
|
32
|
+
callback in case the user returns `null`/`undefined`.
|
|
33
|
+
- Remove dead arguments from a few internal function calls.
|
|
34
|
+
|
|
35
|
+
### Internal
|
|
36
|
+
|
|
37
|
+
- Added GitHub Actions Dependabot configuration.
|
|
38
|
+
- Added `RELEASING.md` documenting the release process.
|
|
39
|
+
- Removed `TEST-PORTING.md` (test migration plan completed with v5.0.0).
|
|
40
|
+
- Suppressed benign Rollup missing-global warnings on standalone
|
|
41
|
+
plugin builds.
|
|
42
|
+
|
|
8
43
|
## [5.0.0] - 2026-04-14
|
|
9
44
|
|
|
10
45
|
First stable release of the @kevinburke/flot fork. The plotting API is
|
package/README.md
CHANGED
|
@@ -42,7 +42,7 @@ plot(document.getElementById('placeholder'), data, options);
|
|
|
42
42
|
Or via `<script>` tag from a CDN:
|
|
43
43
|
|
|
44
44
|
```html
|
|
45
|
-
<script src="https://unpkg.com/@kevinburke/flot@5.
|
|
45
|
+
<script src="https://unpkg.com/@kevinburke/flot@5.1.0/dist/flot.min.js"></script>
|
|
46
46
|
<script>
|
|
47
47
|
Flot.plot(document.getElementById('placeholder'), data, options);
|
|
48
48
|
</script>
|
|
@@ -52,7 +52,7 @@ Or via `<script>` tag from a CDN:
|
|
|
52
52
|
|
|
53
53
|
```html
|
|
54
54
|
<script src="https://unpkg.com/jquery@3/dist/jquery.min.js"></script>
|
|
55
|
-
<script src="https://unpkg.com/@kevinburke/flot@5.
|
|
55
|
+
<script src="https://unpkg.com/@kevinburke/flot@5.1.0/dist/jquery.flot.min.js"></script>
|
|
56
56
|
<script>
|
|
57
57
|
$.plot("#placeholder", data, options);
|
|
58
58
|
</script>
|
package/dist/flot.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @kevinburke/flot v5.
|
|
1
|
+
/*! @kevinburke/flot v5.1.0 | MIT License | https://github.com/kevinburke/flot */
|
|
2
2
|
var Flot = (function (exports) {
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -22,7 +22,9 @@ var Flot = (function (exports) {
|
|
|
22
22
|
},
|
|
23
23
|
|
|
24
24
|
isSafari: function() {
|
|
25
|
-
|
|
25
|
+
var top = window.top;
|
|
26
|
+
if (!top) return false;
|
|
27
|
+
return /constructor/i.test(top.HTMLElement) || (function (p) { return p.toString() === "[object SafariRemoteNotification]"; })(!top['safari'] || (typeof top.safari !== 'undefined' && top.safari.pushNotification));
|
|
26
28
|
},
|
|
27
29
|
|
|
28
30
|
isMobileSafari: function() {
|
|
@@ -30,7 +32,7 @@ var Flot = (function (exports) {
|
|
|
30
32
|
},
|
|
31
33
|
|
|
32
34
|
isOpera: function() {
|
|
33
|
-
return (!!window.opr && !!opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
35
|
+
return (!!window.opr && !!window.opr.addons) || !!window.opera || navigator.userAgent.indexOf(' OPR/') >= 0;
|
|
34
36
|
},
|
|
35
37
|
|
|
36
38
|
isFirefox: function() {
|
|
@@ -348,7 +350,7 @@ var Flot = (function (exports) {
|
|
|
348
350
|
// already been rendered, and remove those that are no longer active.
|
|
349
351
|
|
|
350
352
|
for (var layerKey in cache) {
|
|
351
|
-
if (hasOwnProperty.call(cache, layerKey)) {
|
|
353
|
+
if (Object.prototype.hasOwnProperty.call(cache, layerKey)) {
|
|
352
354
|
var layer = this.getSVGLayer(layerKey),
|
|
353
355
|
layerCache = cache[layerKey];
|
|
354
356
|
|
|
@@ -356,10 +358,10 @@ var Flot = (function (exports) {
|
|
|
356
358
|
layer.style.display = 'none';
|
|
357
359
|
|
|
358
360
|
for (var styleKey in layerCache) {
|
|
359
|
-
if (hasOwnProperty.call(layerCache, styleKey)) {
|
|
361
|
+
if (Object.prototype.hasOwnProperty.call(layerCache, styleKey)) {
|
|
360
362
|
var styleCache = layerCache[styleKey];
|
|
361
363
|
for (var key in styleCache) {
|
|
362
|
-
if (hasOwnProperty.call(styleCache, key)) {
|
|
364
|
+
if (Object.prototype.hasOwnProperty.call(styleCache, key)) {
|
|
363
365
|
var val = styleCache[key],
|
|
364
366
|
positions = val.positions;
|
|
365
367
|
|
|
@@ -713,10 +715,10 @@ var Flot = (function (exports) {
|
|
|
713
715
|
var layerCache = this._textCache[layer];
|
|
714
716
|
if (layerCache != null) {
|
|
715
717
|
for (var styleKey in layerCache) {
|
|
716
|
-
if (hasOwnProperty.call(layerCache, styleKey)) {
|
|
718
|
+
if (Object.prototype.hasOwnProperty.call(layerCache, styleKey)) {
|
|
717
719
|
var styleCache = layerCache[styleKey];
|
|
718
720
|
for (var key in styleCache) {
|
|
719
|
-
if (hasOwnProperty.call(styleCache, key)) {
|
|
721
|
+
if (Object.prototype.hasOwnProperty.call(styleCache, key)) {
|
|
720
722
|
var positions = styleCache[key].positions;
|
|
721
723
|
positions.forEach(function(position) {
|
|
722
724
|
position.active = false;
|
|
@@ -749,7 +751,7 @@ var Flot = (function (exports) {
|
|
|
749
751
|
Canvas.prototype.clearCache = function() {
|
|
750
752
|
var cache = this._textCache;
|
|
751
753
|
for (var layerKey in cache) {
|
|
752
|
-
if (hasOwnProperty.call(cache, layerKey)) {
|
|
754
|
+
if (Object.prototype.hasOwnProperty.call(cache, layerKey)) {
|
|
753
755
|
var layer = this.getSVGLayer(layerKey);
|
|
754
756
|
while (layer.firstChild) {
|
|
755
757
|
layer.removeChild(layer.firstChild);
|
|
@@ -3578,6 +3580,8 @@ var Flot = (function (exports) {
|
|
|
3578
3580
|
markings = markings(axes);
|
|
3579
3581
|
}
|
|
3580
3582
|
|
|
3583
|
+
if (!markings) return;
|
|
3584
|
+
|
|
3581
3585
|
var i;
|
|
3582
3586
|
for (i = 0; i < markings.length; ++i) {
|
|
3583
3587
|
var m = markings[i],
|
|
@@ -4493,7 +4497,7 @@ var Flot = (function (exports) {
|
|
|
4493
4497
|
// Plugin registry. Plugins push to this array to register themselves.
|
|
4494
4498
|
var plugins = [];
|
|
4495
4499
|
|
|
4496
|
-
var version = "5.
|
|
4500
|
+
var version = "5.1.0";
|
|
4497
4501
|
|
|
4498
4502
|
// The main plot function.
|
|
4499
4503
|
function plot(placeholder, data, options) {
|
|
@@ -9215,7 +9219,7 @@ var Flot = (function (exports) {
|
|
|
9215
9219
|
|
|
9216
9220
|
// Encode the string as UTF-8 and convert it to a binary string. The UTF-8 encoding is required to
|
|
9217
9221
|
// capture unicode characters correctly.
|
|
9218
|
-
utf8BinaryString = buildBinaryString(new (TextEncoder || TextEncoderLite)(
|
|
9222
|
+
utf8BinaryString = buildBinaryString(new (TextEncoder || TextEncoderLite)().encode(source));
|
|
9219
9223
|
|
|
9220
9224
|
data = "data:image/svg+xml;base64," + btoa(utf8BinaryString);
|
|
9221
9225
|
img.src = data;
|