Giter Site home page Giter Site logo

grtjn / ml-lodlive-ng Goto Github PK

View Code? Open in Web Editor NEW
0.0 4.0 2.0 2.2 MB

Angular directive that wraps around Matt's ml-lodlive project

Home Page: http://grtjn.github.io/ml-lodlive-ng

License: Apache License 2.0

CSS 3.43% JavaScript 93.34% HTML 3.23%

ml-lodlive-ng's Introduction

ml-lodlive-ng's People

Contributors

grtjn avatar joemfb avatar

Watchers

 avatar  avatar James Cloos avatar Dave Grant avatar

ml-lodlive-ng's Issues

Add zoom buttons on a toolbar

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..

Not opening child nodes on click of .relatedBox. Node moves instead

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?

update ml-lodlive dependency

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.

Legend initialization fails when profile is not in scope

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.

When using slush, the order of script loading results in error

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)

Susequent changes to "iri" does not refresh lodlive

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;
});

TypeError: Cannot read property 'UI' of undefined

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.