Comments (2)
I added sorting for my instance, in src/galaxy/windows/windowView.jsx
I added this function:
// sorting function for sorting by value of object in object
function sort_object_of_objects(data, attr) {
var arr = [];
for (var prop in data) {
if (data.hasOwnProperty(prop)) {
var obj = {};
obj[prop] = data[prop];
obj.tempSortName = data[prop][attr].toLowerCase();
arr.push(obj);
}
}
arr.sort(function(a, b) {
var at = a.tempSortName,
bt = b.tempSortName;
at = at.split(' ', 1)[0].slice(2);
bt = bt.split(' ', 1)[0].slice(2);
return at - bt;
});
var result = [];
for (var i=0, l=arr.length; i<l; i++) {
var obj = arr[i];
delete obj.tempSortName;
for (var prop in obj) {
if (obj.hasOwnProperty(prop)) {
var id = prop;
}
}
var item = obj[id];
result.push(item);
}
return result;
}
And later on in function windowView(x)
call like this:
var items = sort_object_of_objects(windowViewModel.list, 'name');
Not generic, but works for me ;-)
from pm.
I see a lot of value in this, but it comes at cost of O(n * lg n)
on each keystroke.
I'll add sorting as well, and will let users opt in for it. E.g. window title could provide a combobox which allows users to select by name, by in-degree or out-degree.
from pm.
Related Issues (20)
- Scala HOT 1
- adding show modal on event click
- News graph HOT 3
- Failed at start script HOT 5
- help needed for deployment HOT 11
- Need help with data server
- how to set node color and text? HOT 1
- how to generate the position.bin HOT 1
- Updating the live visualisations
- Be case insensitive on python package
- Visualize # of dependents?
- Elm graph HOT 2
- Graph request : Cargo's crates HOT 4
- Swift Package Manager
- Hackage HOT 2
- Build and deploy static React app? HOT 2
- Mispositioned Graph
- draw a nebula map
- how to set color on links
- Enable pinch to zoom via touchpads
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 pm.