Questions tagged [linq.js]

An implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

LINQ.js

This project is an implementation of List and Sequence operations for JavaScript, as inspired by .NET's Language INtegrated Query (LINQ).

Features

  • All .NET 4.0 methods and many extras (with inspiration from Rx, Achiral, Haskell, Ruby, etc...)
  • Complete lazy evaluation
  • Full IntelliSense support for VisualStudio
  • Two versions - linq.js and jquery.linq.js (jQuery plugin)
  • Support Windows Script Host
  • Binding for Reactive Extensions for JavaScript(RxJS) and IntelliSense Generator -> see documentation
  • NuGet packages: linq.js, linq.js-jQuery, linq.js-Bindings

See or MSDN for more information regarding LINQ itself.

LINQ.js official website: http://linqjs.codeplex.com/

108 questions
0
votes
3 answers

how to loop through array of objects and separate nested array of arrays

I have JSON that I currently use for a kendo-ui chart. I need to use the data for a grid so I need to separate the nested data array of arrays into there own object. Javascript or linq.js will work fine. here is the JSON I am starting…
texas697
  • 5,609
  • 16
  • 65
  • 131
0
votes
1 answer

how to match chart data points with chart data points in a array

I am trying to remove data points from a chart series. the series is a array of arrays. I need to loop through it with javascript or linq.js, find the correct one and remove it from the series. I have tried some different methods but I am stuck.…
texas697
  • 5,609
  • 16
  • 65
  • 131
0
votes
4 answers

how to loop through array of arrays and combine values

I need to loop through a array of arrays and calculate the sum of each array. The Json is a kendo-ui chart series with arrays of x,y coordinates. I need to return the sum of the x,y values. linq.js or javascript will work. thanks JSON var =series =…
texas697
  • 5,609
  • 16
  • 65
  • 131
0
votes
1 answer

how to count number of arrays in nested array using javascript

I am trying to make a if statement, I need to determine if the nested array has one array. The objects inside removeByNames is what I need to count. Im using angularJS and linq.js. which ever is more efficient. [{ "style":"smooth", …
texas697
  • 5,609
  • 16
  • 65
  • 131
0
votes
2 answers

Order linq.js results numerically

I am trying to return a list of periods (weeks) in a resource planning tool. Currently I am returning the data and ordering, but linq.js orders alphabetically and returns 1, 11, 12, 3, ... How can I amend the query so that is sorted numerically? 1,…
Ben Irving
  • 461
  • 1
  • 6
  • 21
0
votes
1 answer

how to loop through array of objects and match property with variable using linq.js

I am trying to use linq.js to match a locate a object by a property. the property i need to match is in a object of arrays and then nested in array of arrays. Json i am looping through customSeries = [{"name":"Chantal Hamlet - Green Castle…
texas697
  • 5,609
  • 16
  • 65
  • 131
0
votes
1 answer

How to use linq.js except

I am trying to use linq.js to remove a object from a array. I am customizing highcharts and i need to modify the series. I identified the object I want to remove using .where. When I run it through the Except it is not throwing any errors. it just…
user3349049
  • 172
  • 2
  • 15
0
votes
1 answer

order a collection of momentjs dates by the current date with linq.js

I want to sort in ascending order a collection of momentjs date objects. The problem is that moment.date() returns the day of the month number. How can I sort this by the real date? and still returning momentjs dates from the query? var…
Pascal
  • 12,265
  • 25
  • 103
  • 195
0
votes
1 answer

Creat array of JSON objects from mulitple objects using linq.js

I have a JSON array like so: var jsonArray = [ { Date: "2010-02-25", Size:"Large", Type:"a", Value: "100"}, { Date: "2010-02-25", Size:"Medium", Type:"a", Value: "160"}, { Date: "2010-02-25", Size:"Small", Type:"a", Value: "200"}, {…
user2437588
0
votes
1 answer

Grouping data with JavaScript (linq.js) with multiple grouping criteria?

I've been reading stack overflow for some time now, and found that this time I have a question of my own to post as I can't quite find the answer. I'm quite new to Javascript and I'm having some difficulties getting started coming from a lot of work…
0
votes
1 answer

Adding the percentage of the total to the result

I need help about this function : var ListFruits = Enumerable.From(data) .GroupBy("$.Fruits", "", "d,v => { Fruits:d,NumberFruits:v.Sum('$.NumberFruits|0')}") .Select(" $.Fruits+ ': ' + $.NumberFruits") .ToArray(); // result is…
bao bao
  • 41
  • 7
0
votes
1 answer

orderBy a grouped collection in linq.js

Thats the code which does not work: var grouping = Enumerable.from(periods) .select(function(p){return new PeriodViewModel(p)}) .groupBy("$.periodNumber") .orderBy("$.date") …
Elisabeth
  • 20,496
  • 52
  • 200
  • 321
0
votes
1 answer

How to query/ find a single element in a JSON array with linq.js

I have a JSON array (javascript). I am using linq.js to filter/query the array and find a single element/first element. What is the correct syntax? My data: [{ "Fname": "Chinmaya", "Lname": "Bhatta", "DOB":…
santubangalore
  • 796
  • 1
  • 12
  • 25
0
votes
2 answers

How can get all objects whose sub object's property matches my string array using linq.js?

I have an array of tag names: var tags = ['tagOne', 'tagTwo'] Which I want to use, to query the array below and get all items which match a tag. var items = [ { 'name': 'itemOne', 'tags': [ { name: 'tagOne' } ] }, { 'name': 'itemTwo', …
williamsandonz
  • 15,864
  • 23
  • 100
  • 186
0
votes
1 answer

linqjs group by multiple levels

I am trying to figure out how to group by at multiple levels: Given the following input JSON: [ { "GroupingMajor": "Fruit", "Grouping": "Banana", "Description": "10 Bananas", "Price": 20609.82, }, { "GroupingMajor": "Fruit", …
paligap
  • 942
  • 1
  • 12
  • 28