Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
106 changes: 0 additions & 106 deletions .eslint-default-config.yml

This file was deleted.

28 changes: 0 additions & 28 deletions .eslintrc

This file was deleted.

115 changes: 115 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
{
"env": {
"browser": true
},
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["@typescript-eslint"],
"parserOptions": {
"project": "./tsconfig.json",
"ecmaVersion": 2020,
"sourceType": "module"
},
"ignorePatterns": [
"node_modules",
"dist",
"**/*.d.ts",
"**/*.test.ts",
"gulpfile.js",
"jest.config.js",
"test-setup.ts",
"compileExterns.js",
"grouped-categories-old.js"
],
"rules": {
"camelcase": [
2,
{
"properties": "always"
}
],
"capitalized-comments": ["warn", "always", { "ignoreConsecutiveComments": true }],
"class-methods-use-this": 0,
"comma-dangle": [
2,
"never"
],
"consistent-return": 1,
"default-case": 1,
"default-param-last": 1,
"dot-notation": 0,
"function-paren-newline": 0,
"func-style": 0,
"indent": 2,
"max-len": [
"error",
{
"code": 120,
"comments": 120,
"ignoreUrls": true,
"ignoreComments": true
}
],
"no-dupe-class-members": 2,
"no-inner-declarations": 2,
"no-invalid-this": 0,
"no-shadow": 2,
"no-undef": 0,
"no-underscore-dangle": 2,
"no-unused-expressions": 0,
"no-use-before-define": 2,
"no-useless-constructor": 2,
"no-useless-escape": 2,
"no-useless-return": 2,
"object-curly-spacing": [2, "always"],
"object-shorthand": 2,
"prefer-const": 1,
"prefer-spread": 0,
"prefer-rest-params": 0,
"require-unicode-regexp": 2,
"quote-props": [2, "as-needed", { "keywords": true, "unnecessary": false }],
"semi": 2,
"@typescript-eslint/array-type": [2, { "default": "array-simple" }],
"@typescript-eslint/consistent-type-assertions": 2,
"@typescript-eslint/explicit-function-return-type": [
"error",
{
"allowExpressions": false,
"allowTypedFunctionExpressions": false
}
],
"@typescript-eslint/indent": [
"error",
4,
{
"FunctionExpression": { "parameters": 1 },
"SwitchCase": 1
}
],
"@typescript-eslint/no-empty-function": 2,
"@typescript-eslint/no-empty-interface": 2,
"@typescript-eslint/no-explicit-any": 2,
"@typescript-eslint/no-floating-promises": 1,
"@typescript-eslint/no-inferrable-types": 1,
"@typescript-eslint/no-namespace": 2,
"@typescript-eslint/no-this-alias": 0,
"@typescript-eslint/no-unnecessary-type-assertion": 2,
"@typescript-eslint/no-unsafe-argument": 2,
"@typescript-eslint/no-unsafe-assignment": 2,
"@typescript-eslint/no-unsafe-call": 2,
"@typescript-eslint/no-unsafe-member-access": 2,
"@typescript-eslint/no-unsafe-return": 2,
"@typescript-eslint/no-unsafe-declaration-merging": 2,
"@typescript-eslint/no-unused-vars": 2,
"@typescript-eslint/no-use-before-define": 2,
"@typescript-eslint/no-useless-constructor": 2,
"@typescript-eslint/prefer-as-const": 1,
"@typescript-eslint/prefer-includes": 2,
"@typescript-eslint/prefer-regexp-exec": 2,
"@typescript-eslint/prefer-string-starts-ends-with": 0,
"@typescript-eslint/restrict-plus-operands": 1,
"@typescript-eslint/restrict-template-expressions": 1,
"@typescript-eslint/semi": 2,
"@typescript-eslint/unbound-method": 0
}
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/node_modules
package-lock.json
.DS_Store
**/.DS_Store
55 changes: 55 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Changelog

All notable changes to this project will be documented in this file.

## [Unreleased]

### Added
- TypeScript rewrite of the plugin in `ts/groupedCategories.ts`, aligned to Highcharts APIs.
- Demo page `demo.html` showcasing basic, nested, and styled grouped categories.
- Build pipeline with Gulp + TypeScript + Closure Compiler outputting to `dist/`.
- Source maps for minified build.
- ESLint configuration with TypeScript rules and stable parser settings.
- tsconfig with ES2020 targets and declaration output.
- NPM scripts: `build`, `build:gulp`, `lint`, `compile`, `clean`, `test`, `test:watch`.
- README overhaul with usage, development, and testing instructions.

### Changed
- Path rendering logic to match legacy plugin behavior (using 'M'/'L' commands).
- Grid path buffer type to accept string/number for correct SVG path serialization.
- `groupSize` calculations to mirror legacy spacing/offset behavior.
- Font metrics handling for compatibility across HC versions.
- Relaxed type boundaries at Highcharts internal interop points to avoid false negatives.
- Gulp lint task to correctly complete and ignore declaration/test files.
- Closure Compiler flow to avoid duplicate sourcemap key collisions by splitting stages.
- Babel configuration to preserve ES2020 when desired.

### Fixed
- #111
- #144
- #148
- #149
- #150
- #163
- #177
- #179
- #181
- #185
- #197
- #220
- #227
- #228
- #206
- #212
- #232

### Notes / Migration
- Use `npm run build` for TypeScript build only, `npm run build:gulp` for full pipeline.
- Tests require Highcharts installed (dev dep recommended): `npm i -D highcharts`.
- To install Highcharts from GitHub, prefer `--ignore-scripts` or use the published package.
- Recommended editor settings: ensure ESLint extension uses the workspace config.

---

## [1.3.2] - 2025-09-23
- Legacy JS plugin version; current release supersedes it with TS rewrite and modern tooling.
68 changes: 68 additions & 0 deletions bug1.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes">


<title>Grouped Categories - Highcharts module</title>

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="./dist/grouped-categories.js"></script>

</head>
<body>
<div id="main-content" style="padding: 20px;">

<div class="chart-container" id="chart">

</div>


<script>

// Sample initial data
let data = [304154,
145588,
30415,
145588,
30415,
14558,
304154,
1455889,
30415,
1455889,
30415,
145588];
let categories1=categories2=
[
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante quam, porttitor vitae dui non, congue pulvinar lorem. Ut non commodo lacus, id tincidunt justo. Aenean accumsan, ante vel malesuada faucibus, odio orci molestie est, dignissim blandit diam magna a mauris.",
" Cras malesuada, arcu sed ornare ultrices, magna turpis dictum risus, vitae egestas nulla tortor ut ex."
,
" Cras malesuada, arcu sed ornare ultrices, magna turpis dictum risus, vitae egestas nulla tortor ut ex."
,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante quam, porttitor vitae dui non"
,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante quam, porttitor vitae dui non."
,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante quam, porttitor vitae dui non"
,
"Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec ante quam, porttitor vitae dui non"

]
window.chart = new Highcharts.Chart({
chart: {
renderTo: "chart",
},
xAxis: {
categories: categories1,
},
series: [{
type: 'bar',
data: data
}]
});
</script>

</body>
</html>
Loading