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

Event names with dashes are not recognised #2022

Closed
maxkfranz opened this issue Nov 17, 2017 · 0 comments
Closed

Event names with dashes are not recognised #2022

maxkfranz opened this issue Nov 17, 2017 · 0 comments
Labels
bug A bug in the code of Cytoscape.js
Milestone

Comments

@maxkfranz
Copy link
Member

Issue type

Bug report

Environment info

  • Cytoscape.js version : 3.2.5
  • Browser/Node.js & version : All

Current (buggy) behaviour

Event names with dashes or underscores are recognised incorrectly.

Desired behaviour

Allow dashes and underscores in event names.

Minimum steps to reproduce

cy.on('foo-bar');

cy.on('foo', () => console.log('foo'));

cy.on('foo-bar', () => console.log('foo-bar'));

cy.emit('foo-bar'); // prints 'foo' instead of 'foo-bar'
@maxkfranz maxkfranz added the bug A bug in the code of Cytoscape.js label Nov 17, 2017
@maxkfranz maxkfranz added this to the 3.2.6 milestone Nov 17, 2017
metincansiper added a commit to iVis-at-Bilkent/cytoscape.js that referenced this issue Oct 8, 2018
* Add 3.1.2

* Add 3.1.2

* Preparing to publish 3.1.2

* Smaller file set sent to gh-pages

* The non-min file isn't needed

* Disable sourcemaps for dist builds (to save space in repo)

* Just use jq for now

* rm angular link

* Smaller file set send to gh-pages

* The non-min file isn't needed

* Disable sourcemaps for dist builds (to save space in repo)

* Just use jq for now

* rm angular link

* Remove duplicate line

* Mentions of `makeLayout()` in the docs should be changed to `layout()`
for 3.x cytoscape#1872

* Mentions of `makeLayout()` in the docs should be changed to `layout()`
for 3.x cytoscape#1872

* `animate: 'end'` support for CoSE cytoscape#1646

* Document `eles.toArray()` cytoscape#1817

* - Add `transform` option to `nodes.layoutPositions()`
- Correct (node, i) order for internal `boundingBoxAt()` function

Ref : `nodes.layoutPositions()` option to transform final `{ x, y }` cytoscape#1695

* Implement the `animateFilter` option for `layoutPositions()`

Ref : `animateFilter()` option for `eles.layoutPositions()` cytoscape#1870

* Don't test master on node < 4

* - Invalidate the cached container client co-ordinates on animationend and transitionend for container and ancestors
- Co-ordinate projection takes into account effective scale

Ref : cytoscape#1756

* Remove duplicate line

* Merge branch 'docs/includeOverlays' of https://github.com/josephst/cytoscape.js into josephst-docs/includeOverlays

* Extra data passed to `.emit()` is not passed to bubbled handlers cytoscape#1877

* Extra data passed to `.emit()` is not passed to bubbled handlers cytoscape#1877

* Position animations can apply to locked nodes cytoscape#1876

* Position animations can apply to locked nodes cytoscape#1876

* Spring animation should always end at 100% cytoscape#1875

* Spring animation should always end at 100% cytoscape#1875

* Re-organise core animation code so that the Animation object can be
cleaned up in future

* Remove jscs

* Add contributor guides to accompany blog post cytoscape#1840

Someone the old merge was overridden

* Add contributor guides to accompany blog post cytoscape#1840

Someone the old merge was overridden

* Document `eles.removeStyle()` cytoscape#1883

* Document `eles.removeStyle()` cytoscape#1883

* Document `eles.getElementById()` cytoscape#1880

* Document `eles.cy()` cytoscape#1879

* Explicitly list supported compound shapes in the style section of the
docs cytoscape#1892

* Explicitly list supported compound shapes in the style section of the
docs cytoscape#1892

* Add 3.1.3

* Add 3.1.3

* Preparing to publish 3.1.3

* Intersections need to be cached for bundled beziers for *-endpoint: outside-to-line

Ref : Reduce intersection calculations for edges cytoscape#1478

* Intersections need to be cached for bundled beziers for *-endpoint: outside-to-line

Ref : Reduce intersection calculations for edges cytoscape#1478

* Specify endpoints & edge type for compounds in the default stylesheet cytoscape#1669

* Organise the collection dimensions code a bit

* Remove 'use strict' and let webpack handle it

* API for accessing calculated points for edges cytoscape#1552

Docs TODO

* Docs for points functions

* Fixed benchmark gulp targets

* Doc maker can be run directly; fix some issues building the docs on unstable

* Bluebird is still needed for running tests on node@4

* - Add math functions for converting positions : model <=> rendered
- Refactor zoom() function to use a separate getter
- Use position conversion function for animation
- Micro-optimisations / clean up for animation()
- Allow animating via zoom() syntax
- Docs for zoom object animation
- Misc linting

* Document background event for nodes cytoscape#1711

* - Add ghost properties
- Lint and var => let for drawing-elements.js
- Bounding box takes into account ghost properties
- Split drawing node steps into separate functions
- var => let for drawing-nodes.js
- Nodes have duplicated fill and stroke for `ghost: yes`
- var => let for drawing-edges.js
- Refactor edge `overlayInstead` flag : use separate, internal functions instead
- Separate out steps for drawing edges into closures to make painter's algorithm clearer
- Ghost properties inherit element opacity

Ref : Node ghost visual style cytoscape#1197

* - Refactor darken
- Node paint functions allow independent opacity values
- Ghost takes into account { shape, images, pie, darken, border }
- Separate style setup for nodes
- Darken and images should take into account the parent effective opacity (and the ghost effective opacity)
- Documentation for ghost properties

Ref : Node ghost visual style cytoscape#1197

* Fixes tests re. zoom refactoring changes

Ref : Animate zoom about a point like `cy.zoom({ level, position })`

* Barrel shape: set max values for curve width/height offsets

* Improve issue template

* Improve issue template

* Correct spelling

* Correct spelling

* Fix edge types demo : Points should be specified as arrays or separated
by spaces

* Fix edge types demo : Points should be specified as arrays or separated
by spaces

* Add cytoscape-canvas extension to list

* Add cytoscape-canvas extension to list

* Add to "who uses" list
- SNIK from U. Leipzig, IMISE
- TissueNet and DiffNet from BGU

* Add to "who uses" list
- SNIK from U. Leipzig, IMISE
- TissueNet and DiffNet from BGU

* Add euler layout to extension list

* Add euler layout to extension list

* Add 3.1.4 to version list

* Add 3.1.4 to version list

* Preparing to publish 3.1.4

* Add Zenodo DOI badge and release instructions for Zenodo DOIs

* Add Zenodo DOI badge and release instructions for Zenodo DOIs

* More complete Set internal polyfill

* set.delete() not set.remove()

* Improved Set

* Refactored element classes to use Set (cytoscape#1899)

* Test

* test2

* Refactored element classes to use Set

* changed gulpfile

* Benchmark testing

* Benchmark testing

* Benchmark testing

* Fixed typo, required set.js, copied set correctly

* Fixed some formatting

* Improves Set iterator

* Remove unneeded .add() block; use Set constructor cytoscape#1843

* Bluebird and gulp-download are dev dependencies, not dependencies

* Reduced (only high performance) feature set for internal Set polyfill

* Added benchmark tests for classes and fixed polyfill for eles.classes() (cytoscape#1903)

* Added benchmark tests for classes

* fixed polyfill in classes()

* Safer object use in Set polyfill

* Exporting JPG with hollow arrows makes them black cytoscape#1907

* Exporting JPG with hollow arrows makes them black cytoscape#1907

* Update style.md

* Document svg considerations  cytoscape#1856

* Document animateFilter and expose the option in each bundled layout cytoscape#1870

* Document eles.merge(), eles.unmerge() cytoscape#1818

* Document the transform option for `nodes.layoutPositions()`, document the option for each bundled layout.  cytoscape#1695

* Add the Kanji Map and Classcraft to "who uses" list cytoscape#914

* Add the Kanji Map and Classcraft to "who uses" list cytoscape#914

* Issue template should indicate that extension issues must be filed in
extension repos.

* Issue template should indicate that extension issues must be filed in
extension repos.

* Changing the arrow type does not update the calculated edge points cytoscape#1922

* Changing the arrow type does not update the calculated edge points cytoscape#1922

* Ensure that the `lastCurveStyle` value is set for haystack edges so that control point caching doesn't get false positives.

Edges do not follow nodes after several type changes cytoscape#1910

* Note that merge() and unmerge() can be used to treat a collection as
mutable in Notation cytoscape#1818

* Put svg considerations in the list, because the docs doesn't support more than 3 header levels. cytoscape#1856

* `transform` may not be worthwhile documenting officially for cose since it would only work when `animate:'end'` cytoscape#1695

* Ensure that the `lastCurveStyle` value is set for haystack edges so that control point caching doesn't get false positives.

Edges do not follow nodes after several type changes cytoscape#1910

* Add klay to layout extension list

* Add klay to layout extension list

* Make publishing reference in scaffolding section more general

* Make publishing reference in scaffolding section more general

* Add 3.1.5 to release list

* Add 3.1.5 to release list

* Preparing to publish 3.1.5

* Put license as first badge

* layoutDimensions() should allow for nil values for options.  Defaults
should be assigned for each field. cytoscape#1626

* Add 3.2.0 to the version list in the docs

* Update spread demo to use extension v1.3.1

* Preparing to publish 3.2.0

* Fix backticks in architecture section

* Preparing to publish 3.2.0

* Fix docs for eles.on()

* Delegated event callbacks do not have `this` set correctly cytoscape#1930

* Some versions of IE on some versions of Windows report `event.pointerType` as an int cytoscape#1931

* IE doesn't support `Number.MAX_SAFE_INTEGER` cytoscape#1932

(Also lint zsort)

* Only ES5 can be used in tests in order for them to run on older versions of Node

* Add 3.2.0 to version list in docs

* Reverse order for 3.2.1 and 3.2.0 in release list in docs

* Preparing to publish 3.2.1

* Remove `publish` script from package.json

* User thrashing of the compound dimensions cache during batching lowers performance cytoscape#1939

* Edge width and arrow scale should be taken into account for control point calculation caching cytoscape#1912

* Edge width should use the preferred units value, in case the units change. cytoscape#1912

* 'pos' in CRp.drawPie is not assigned. cytoscape#1935

* Dynamic change of text-rotation for edge is not reflected when curve-style is set to bezier cytoscape#1936

* `curve-style: bezier` for image and dagre demos cytoscape#1938

* Cached intersections should take into account bundle reversing in the pair edge set cytoscape#1942

* Bundled bezier edges should allow independent control point weights cytoscape#1950 cytoscape#1945

* Edge point functions descriptions not included in the docs cytoscape#1951

* - Emitter copies the listener list when removing listeners while emitting.
- Removing a listener exits the split events loop early on match.  It will only ever match once anyway, so the additional checks are wasteful.
- Fix indentation on emit().

cytoscape#1953

* More tests for Emitter cytoscape#1953

* "__________cytoscape_container" class repeatedly added to div on renderer re-init cytoscape#1955

* Clarify behavior and documentation when passing "empty collection" to fit, center, animate cytoscape#1954

* Add 3.2.2 to release list for docs

* Fix cose options in demo

* Add 2.7.19 - 2.7.24 to the releases list in the docs

* Preparing to publish 3.2.2

* Add CDNJS version badge in README.md cytoscape#1957

* Allow gulp targets to be used on old versions of node, pulling in webpack dependency on demand.

* Compatibility for IE and old versions of node for cytoscape#1843 cytoscape#1961

nvm use 6 && npm run build-cjs && nvm use 0.10 && npm run test-build

* Always use internal `Set`s and `Map`s cytoscape#1843 cytoscape#1961

* Fix unwanted empty() call on boundingBox

* Improvements to docs
- Remove dead "who uses" links
- Note env requirements cytoscape#1961
- List cytosnap

* Regression test for cytoscape#1965

* Bounding box updates fails for edges when headless with style enabled cytoscape#1970

* Add 3.2.3 and 2.7.25 to release list in docs

* Preparing to publish 3.2.3

* Rework triangle cross (cytoscape#1972)

* rework triangle cross wip

* Rework triangle cross
- base implementation off of triangle-tee
- compute crossline points to match edge width
- modify arrowshape collide and rough collide api to include edgeWidth as a parameter

* Removing a delegated listener when non-delegated listeners exist on a target cytoscape#1980

* `cy.resize()` is called just after init cytoscape#1988

In order to solve this, it's necessary for `this.load()`-- which inits dom listeners etc -- to be called when we get an `init` notification.  The `CanvasRenderer` writes to the container's attributes, and `load()` sets up a `MutationListener` to detect possible resizes made (e.g. by applying a class to the container).  The core sends an `init` notification when a new renderer is created.  This ensures that `load()` is always called after all renderer constructors are called.

* `cy.style()` is not always available cytoscape#1989

Make the default stylesheet available before creating the renderer and loading the external stylesheet.  When loaded, append the external stylesheet to the existing style.

* Add 3.2.4 to release list in docs

* Add Southwest Harbor Public Library to who-uses list

* Preparing to publish 3.2.4

* Fix `eles.toArray()` formatting in docs

* No box selection in compound nodes if parent is ungrabified cytoscape#1995

* Separate lines for badges for better alignment

* Use holes in depths to ensure that removals don't invalidate indicies.  `assignDepthsToEles()` cleans out holes.

Fix depth adjustment in breadthfirst layout cytoscape#1992

* Can't use the usual reverse-order for splicing in depths of BFS layout on account of saving the indices cytoscape#1992

* Fix spelling issues in "SVG considerations" in the docs cytoscape#2003

* `eleJson.scratch` fields should start with underscore in examples in docs cytoscape#1999

* Example for `eles.umerge()` is malformed in the docs cytoscape#1996

- Fixes formatting.
- Clarifies on what collections these functions should be used.

* Unbundled bezier edges sometimes don't render cytoscape#2005

Commit f07f5b8 causes the issue (according to git bisect).  It has an inconsistent signature for the refactored function put into `math`.  This fixes the issue by putting `padding` as the last parameter in the function signature.  That also makes `math.checkInEllipse()` more consistent with the other geometric shape functions.

* Add 3.2.5 to release list in docs

* Add CyberSift to who-uses section of the docs cytoscape#914

* Preparing to publish 3.2.5

* Add Zenodo and OMIC Tools links to docs; fix Younivise link

* Newly added elements should not have their style initially updated twice from false background image loading detection cytoscape#2016

Caused by : Allow for background image properties to be specified as multiples (i.e. arrays or space separated strings) cytoscape#1747

The check for whether background images are loading is incorrect, as the count of images does not take into account invalid/null entries.

* Adding the edge parameter to anonymous function

* `border-style: dotted` isn't applied properly cytoscape#2018

* Event names with dashes are not recognised cytoscape#2022

* Example for event namespace in the docs is reversed cytoscape#2023

* Add 2.7.26 and 3.2.6 to release list in docs

* Preparing to publish 3.2.6

* Revise queueing in the ElementTextureCache cytoscape#1998

(1) When an element is invalidated, remove any requests it may have from the queue.
(2) Update the bounding box of an existing request when a new request comes in.
(3) Do not check source and target positions for a delta when dequeueing.  This is not necessary, because (1) and (2) would create the same effect through invalidating the edge.

* Revise texture queueing requests re. bb, position, extraneous dequeues cytoscape#1998

- Remove remaining bb and position storing in element texture queueing requests.
- When a texture request comes in for an element with an existing cache at the specified level, ignore the request.

* Do not omit non-style-dirtying events from the per-element event list cytoscape#2026

Ref : Background images do not invalidate the element texture cache if only dirtying position events come in cytoscape#2026

* Add 3.2.7 to the release list in the docs

* Preparing to publish 3.2.7

* Automatically update the copyright year span in LICENSE when publishing a release cytoscape#2040

* Add 3.2.8 to release list in docs

* Preparing to publish 3.2.8

* Update to webpack@3 and disable all webpack node polyfills cytoscape#2051

* Add package-lock.json to allow for reproducible builds cytoscape#2051

* Add viewport event to the docs cytoscape#2048

* Selector function arg uses `this` in docs cytoscape#2057

* Add popper extension to the list of extensions in the docs

* `vee` edge arrow is missing from the docs cytoscape#2065

* `vee` edge arrow is misaligned with the line for a thick edge cytoscape#2066

* `triangle-backcurve` arrow can be be misaligned for thick edges cytoscape#2067

* Add 3.2.9 to the release list in the docs

* Preparing to publish 3.2.9

* The `remove` event is emitted on already removed elements cytoscape#2074

* Fixed redundant typo (appplication -> application) in demos

Signed-off-by: Olivier Gayot <olivier.gayot@sigexec.com>

* Cherrypick to master : Merge pull request cytoscape#2073 from d2fong/unstable

Slightly better approximation of barrel curve pts for line intersection

* Add 3.2.10, 2.7.28, & 2.7.27 to docs release list

* Preparing to publish 3.2.10

* For each 'style' dirty event, w.r.t. the element texture cache, manually diff the parent opacity.  Invalidate the descendants when the diff is non-empty.

Ref : Opacity of child node is not updated for certain zoom levels after parent opacity is overriden cytoscape#2078

* Correct errors in docs for `node.layoutDimensions()` cytoscape#2080

* Add 2.7.29 and 3.2.11 to the list of releases in the docs

* Preparing to publish 3.2.11

* Clean up dead links in the "used by" section and add MetagenomeScope

* Add node-html-label to the extension list cytoscape#2083

* Reverse order of visibility check and bad line / bad bezier checks in `CanvasRenderer.prototype.drawEdge()`, and add null check on `ele._private.rscratch.allpts`.

The visibility check is a historical check, used before the texture caching.  It's useful as a sanity check now, but it makes sense to check it before renderer scratchpad data (calculated rendered style), as cases like image export may call `drawEdge()` indiscriminately.  The null check on `allpts` is inexpensive and generally good practice, even though `allpts != null` for all visible edges.

Ref : TypeError during export to png/jpg if some edges were never shown before cytoscape#2096

* Include node@8 explicitly in `.travis.yml`

* Disable node@stable (i.e. currently v10) in `.travis.yml` as it doesn't
work with gulp.

It should be OK on the unstable (3.3) branch, as gulp is no longer used.

* Animation of percent property values (e.g. pie charts) not working cytoscape#2099

Normally, a value in preferred units can be parsed back in a cycle.  This is not the case for percent values.  The preferred values range on [0, 1] whereas they are parsed as implicitly having `%` at the end if just a number is specified.  Consider for v4 changing parsing for percent values s.t. unitless values range on [0, 1] and values with `%` range on [0, 100].  For now, just add a case for percent units to use `value` instead of `pfValue`.

* Add 3.2.12 to the release list in the docs

* Preparing to publish 3.2.12

* add required function to falseThread that is called if a layout.run() is called more than once in non-weaver set-up.

* Allow null values to be passed to `style.parse()`

Ref : Removing 'background-image' and adding 'background-color' instead cytoscape#2124

* Deprecate `cy.collection( val )` cytoscape#2126

* Revisions to the "who uses" list

* A `multiple:true` property that is not unitless does not have an accurate `strValue` representation:  The units are missing from each value.

Ref : cy.style().json() background-width/height misses "%" in value cytoscape#2121

* Add 3.2.13 to release list in the docs

* Preparing to publish 3.2.13

* `edge.controlPoints()` is `undefined` for loops

Ref cytoscape#2139

* `edge.controlPoints()` is undefined for edges between a parent node and one of its descendants.  While these edges aren't strictly loops, they are displayed in a similar way to loops using two beziers.

Ref : `edge.controlPoints()` is `undefined` for loops cytoscape#2139

* Add 3.2.14 to the release list in the docs

* Preparing to publish 3.2.14

* Add explicit stylesheet transition animation tests

Ref cytoscape#2148

* Remove warning in style tests

* Tests for `transition-property` requires a comma-separated list in 3.2

Revert "Remove warning in style tests"

8afe1ee

* When in an active touch cycle in the renderer and neither panning nor node-dragging is active, remove the active background indicator.

Ref : The active background indicator remains when making a non-pan touch swipe cytoscape#2156

* End the renderer's  touch gesture cycle only if all fingers are removed from the screen.

Ref : A touch gesture cycle can be cut short cytoscape#2157

* Add 3.2.15 to release list

* Preparing to publish 3.2.15

* Ignore label value processing if the raw value is empty.

Ref : Removing text from edge's label keeps background visible cytoscape#2164

* Fix `source-text-rotation` and `target-text-rotation` not being used for source and target labels.  Previously, `text-rotation` was erroneously applied to the display of source and target labels, but the correct properties were used for bounds calculations.

Ref : Source and target labels use `text-rotation` rather than `source-text-rotation` and `target-text-rotation` for display cytoscape#2167

* Update release list in the docs with 3.2.16

* Preparing to publish 3.2.16

* Remove the console.logs used for debugging and forgotton

* Added a note about upgrade
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A bug in the code of Cytoscape.js
Projects
None yet
Development

No branches or pull requests

1 participant