Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed conditional bug when passing an HTML node as container #18

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ In the above example first segment, "Direct", will have a gradient,

| Option | Description | Type | Required | Options | Default | Example |
|--------|-------------|------|----------|---------|---------|---------|
| `container` | Selector of the element that will hold the chart | `string` | Yes | | | '.funnel-container' |
| `container` | Selector of the element that will hold the chart | `string`, `node` | Yes | | | '.funnel-container' |
| `direction` | Whether the chart visualization is displayed vertically or horizontally | `string` | No | 'vertical', 'horizontal' | 'horizontal' | |
| `gradientDirection` | Whether the gradient applied to the segments of the graph is displayed from top to bottom or from left to right | `string` | No | 'vertical', 'horizontal' | 'horizontal' |
| `displayPercent` | Whether to display the automatically calculated percentage values below the labels | `boolean` | No | `true`, `false` | `true` | |
Expand Down
2 changes: 1 addition & 1 deletion dist/js/funnel-graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ function () {
if (!this.container) {
throw new Error("Container cannot be found (selector: ".concat(this.containerSelector, ")."));
}
} else if (this.container instanceof HTMLElement) {
} else if (this.containerSelector instanceof HTMLElement) {
this.container = this.containerSelector;
} else {
throw new Error('Container must either be a selector string or an HTMLElement.');
Expand Down
2 changes: 1 addition & 1 deletion dist/js/funnel-graph.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "funnel-graph-js",
"version": "1.4.2",
"version": "1.4.3",
"description": "SVG Funnel Graph Javascript Library",
"main": "main.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion src/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class FunnelGraph {
if (!this.container) {
throw new Error(`Container cannot be found (selector: ${this.containerSelector}).`);
}
} else if (this.container instanceof HTMLElement) {
} else if (this.containerSelector instanceof HTMLElement) {
this.container = this.containerSelector;
} else {
throw new Error('Container must either be a selector string or an HTMLElement.');
Expand Down