Angular directive that wraps around Matt's ml-lodlive project
Docs and examples available here: http://grtjn.github.io/ml-lodlive-ng
Angular directive that wraps around Matt's ml-lodlive project
Home Page: http://grtjn.github.io/ml-lodlive-ng
License: Apache License 2.0
Angular directive that wraps around Matt's ml-lodlive project
Docs and examples available here: http://grtjn.github.io/ml-lodlive-ng
ml-lodlive gives a div with class lodlive-graph-context
, that would be a perfect place to apply transform: scale(..)
via CSS. The ml-lodlive directive in this project includes a legend directive that could be generalized into a toolbar directive including zoom buttons for zoom in (+), zoom out (-), and a reset zoom. I guess a zoom to fit will be tricky..
When you click one of a node's .relatedBox circles it doesn't open the child node.
On the demo page: it causes the whole parent node to move instead.
I've done some digging, as i'm getting a similar problem on my own extension.
It seems draggable.js is hooving up all the clicks.
container.on('mousedown', draggableSelector, function(event) {
// mark the node as being dragged using event-delegation
dragState.target = $(this);
dragState.panning = false;
// store offset of event so node moves properly
dragState.offsetX = event.offsetX;
dragState.offsetY = event.offsetY;
event.stopPropagation();
event.preventDefault();
});
Could this be a packaging error? As i assume this works fine on ml-lodlive?
Likely requires changes in ml-lodlive to get easy access to data, and (potentially) make things interactive..
An updated version of ml-lodlive
has been released (0.4.0
). Please update bower.json to reference this version, as it has many fixes and improvements.
Note: for the purposes of this component, this release is mostly backwards compatible.
Accept header PR on ml-lodlive is finally processed into dist, we can upgrade to ml-lodlive#0.3.1.
Allow custom titles for relationships, and show them alphabetically sorted.
I'm trying to use my own endpoint but it is not clear to me how I would create a new provider.
Can you give a quick example?
If the profile is not initialized when the MLLodliveLegendCtrl is created, then the initRelationship() function causes and error because the condition checking for (model.profile.UI) gets a TypeError since (model.profile) is null. Need to update the if-statement to check that (model.profile) exists as well.
James Kerr ran into this, and I confirmed: with a vanilla slush app, relying on wiredep
to inject scripts into index.html
, working through the QuickStart steps results in an error:
angular.js:12783 TypeError: angular.element(...).lodlive is not a function
at ml-lodlive-ng.js:21
at Scope.$digest (angular.js:16203)
at Scope.$apply (angular.js:16467)
at done (angular.js:10852)
at completeRequest (angular.js:11050)
at XMLHttpRequest.requestLoaded (angular.js:10991)
There is a workaround, by moving ml-lodlive.complete.js
before angular.js
in index.html
. But, since ml-lodlive.complete.js
relies on jQuery, jquery.js
has to go to the top of the list. (Looking through some forums, it might actually be preferable to load jQuery first ... but that is an issue for slush itself)
The following line in directive's link: angular.element($elem).lodlive({ profile: $scope.profile, firstUri: newVal, ignoreBnodes: true });
actually creates a new lodlive instance. Therefore, subsequent updates to iri
after it first gets initialized result in multiple inserted lodlive divs placed on top of each other (the first instance being always on top) that gives an outward appearance of lodlive not "refreshing".
Possible solution is as follows:
$scope.$watch('iri', function(newIri, oldIri) {
var ll = angular.element($elem).lodlive(); // lodlive() returns null if not yet initialized
if (!ll && $scope.profile && newIri) {
angular.element($elem).lodlive({ profile: $scope.profile, firstUri: newIri, ignoreBnodes: true });
}
else if (ll && newIri) {
ll.context.empty(); // it seems that w/o this call, init(uri) will "append" rather than reset
ll.init(newIri);
}
});
A workaround for projects using the current version is to use angular (1.4) decorators:
angular.module('app').decorator('mlLodliveDirective', function($delegate) {
var directive = $delegate[0];
// completely replace link: to fix updating of iri
var link = function($scope, $elem, $attr) {
// Use new $scope.$watch() code here
};
directive.compile = function() {
return function(scope, elem, attr) {
link.apply(this, arguments);
};
};
return $delegate;
});
Hi,
I'm getting below error while working on this
Error:
TypeError: Cannot read property 'UI' of undefined
Attached the html template for the same: sample3.zip
Kindly let me know how to fix this, I'm new to angular js, just want to show data from MarkLogic if the dbpedia endpoint works.
Thanks,
Rajesh
Expects string/array instead of object..
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.