Comments (5)
I just tried some examples and didn't see any issues with it being used with v5, are you running into a specific issue? I can update the docs to say that it also works with v5 otherwise.
from d3-annotation.
No, I can't get this library to monkey patch d3 as it seems is intended, none of the methods show up. Thought that was maybe a d3 mismatch.
I'm trying various combinations of
import * as d3 from 'd3';
import * as d3Annotation from 'd3-svg-annotation';
but something about the bundling process isn't working. Why was that method chosen out of curiosity, is that idiomatic to d3?
from d3-annotation.
I have the same problem. Unable to use this lib with Angular. Any update on it?
from d3-annotation.
"d3": "^5.15.0",
"d3-svg-annotation": "^2.3.1",
works for me with these versions ¯\(ツ)/¯
from d3-annotation.
I'm not able to extend d3 into using the annotation library.
Having the types for d3 just throw error on d3.annotation() does not exists, while removing the type obviously throw the same error in runtime
After having installed the npm packages, I can use d3 with this import * as d3 from 'd3';
, but I'm not able to extend it into using d3-svg-annotation
Haw have you done it? Sorry for the silly question
Edit:
Got it working, it was indeed a silly question.
Imported as:
import * as d3Annotation from 'd3-svg-annotation'
Using as:
let makeAnnotation: any = d3Annotation.annotation().annotations(labels).type(d3Annotation.annotationCalloutCircle).accessors({
x: function x(d: any) {
return _x(moment.utc(d.date, "YYYY-MM-DDTHH:mm:ss.SSSZ").toDate());
},
y: function y(d: any) {
return _y(d.close);
}
}).accessorsInverse({
date: function date(d) {
return timeFormat(_x.invert(d.x));
},
close: function close(d) {
return _y.invert(d.y);
}
// @ts-ignore
}).on('subjectover', function (annotation) {
...
}).on('subjectout', function (annotation) {
...
});
Do note the use of any and @ts-ignore to get rid of type errors.
from d3-annotation.
Related Issues (20)
- Annotations type change dynamically HOT 5
- The property `subject` don't work when config the annotation in version 2.2.2 HOT 3
- Overlapping Demo is broken HOT 2
- Multiple colors and text justification within annotation label HOT 1
- Drag connector end when editMode is enabled HOT 3
- EditMode not working properly in ShadowDOM HOT 5
- Missing Typescript type - notePadding() HOT 1
- Custom orientation being overridden HOT 3
- TypeScript type definition missing Annotation.on HOT 1
- Canvas scaling? HOT 2
- Note placement HOT 3
- text.annotation-note-label overlaps text.annotation-note-title (rather than offsetting)
- Typescript error when calling makeAnnotations from the example
- please upgrade to d3 v6
- editMode Does not work after d3 v6 HOT 1
- Is it possible to create a hyperlink for annotation's title?
- subjectout is triggered constanly when hovering (Firefox)
- annotations editable by end user
- Will the package be updated? Can we do PRs?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from d3-annotation.