I have installed ELK tools but somehow I wanna take the data from elasticsearch and created some graphs with the data on my own instead of using Kibana. I have notified there are some tools like elasticsearch.js but I couldn't get any ideas on how to start it out, i.e. what should I do in order to extract those data and customize my graphs with js.
Would anyone who have previous experience can share about it.
Great thanks in advance.
I have never worked on such a graph, but I guess it should not be very complicated to build. Since, elasticsearch does provide REST API and returns a JSON response, this JSON response can be handled by writing a custom toolkit which can represent that in format you want to.
There are toolkits available to handle JSON visualization like Protovis or json-stat. May be you can look at those, and even if nothing exists you can very well write your own toolkit
Related
I need to develop a small application integrated in sharepoint. I am using the 2019 version on on premise. The application consists of data entry, sql queries for loading data into the fields. I want to use the latest approaches for this purpose. I still have time, but I don’t know which way to go.
I looked at a lot of solutions without code, but as I understand it, I need to move in the direction of JS, at the same time I want to save it in sharepoint lists or where to store the entered data. But how can I get data from the external MSSQL database, use node.js or the web part, REST. I am very confused, help me please. I developed applications on C # windows form with ado.net, if I know the direction I will figure it out in JS.
So following up with the comments, you could implement the following stack:
React or Vue: To implement a simple GUI to perform basic CRUD on you DB
NodeJS: To handle the data manipulation (if any) and push things to Sharepoint
Take a look at the very popular MERV stack for inspiration on the app structure. (MERV uses MongoDB, but the logic would be the same if you swap that bit for MySQL)
Using NodeJS you can leverage Sharepoint REST API using the available libraries. Check out this tutorial for details on the implementation.
I'm trying to find examples or tools that can create a bar graph in a web browser. I'll be sending the data from the server via a web socket and as the data is received I want the 'height' of each bar to change, reflecting the data received.
So the user can see the graph changing as data is received to.
I've seen a number of examples, but I can't see one that will do the above. Something like D3 looks really good but seems to have a steep learning curve and there seem to be quite a few out there it's getting quite confusing.
I'm looking for something simple and quick to do.
Thanks
What you really need to do is find a simple charting library which supports some form of redraw or a way of binding a data model and detecting changes to that model. The common steps are:
Create chart object with initial set of data
Draw initial chart
Get update over WebSocket connection
Update data set
Redraw chart
The complexity tends to come in with the libraries as the general process is pretty simple.
Some examples
A realtime charting example which just displays votes and updates in realtime can be found via .net magazine tutorial on Code a real-time survey with HTML5 WebSockets. It uses Pusher, who I work for.
There's also an example that uses DJ, Python, Pusher and the Twitter streaming API here:
http://bieber.nixonmcinnes.co.uk/
The code can be found here:
https://github.com/nixmc/pusher-d3-demo
Blog post here:
http://www.nixonmcinnes.co.uk/2012/04/20/what-can-we-learn-from-the-real-time-web-and-justin-bieber/
The simplest example
There's also a video of using Pusher with SmoothieCharts here:
http://www.youtube.com/watch?v=VLTsT30TZYw
You might want to look at d3.js for the client-side drawing of the "live" chart. It works really well, and doing things like live bar (or other type) charts is really easy, with syntax similar to JQuery. As for getting the data over the WebSocket, the various websocket packages (full disclosure--I work for Kaazing, that pioneered WebSockets) can pretty much all do this.
Have a look at XSockets.NET, there is an Nuget-Package available for setting up a WebSockets/Realtime service, the JavaScript API is easy to get started with. You can also use the hosted version , where you run JavaScript "only" , More info regarding XSockets.NET will be found on http://xsockets.net
The hosted service on http://live.xsockets.net for "javascript" version, A playground for JavaScript developers found on http://xfiddle.net/
Regarding Graph's, there is an example on jsfiddle, it contains an Wijmo chart (bar), that reacts on user input's in realtime. There is an link to that example in xfiddle.net
For new visitors to this old question, the following is currently one of the simplest and most straightforward examples of websocket use to change a plot in real-time (implemented using google charts paired with either python or perl):
https://github.com/albertobeta/UberSimpleWebsockets
I've googled this loads and am sure there is an obvious way that I'm missing, but..does anyone know how to approach rendering example source code that is kept in a noSql database?
I am writing a javaScript blog site and want to show example code rendered from backbone templates whose models are populated from a mongoDB database.
Most of the google results offer a variety of syntax highlighting pulg-ins, but how would I format the code to preserve indentation etc as the code will be flat in a JSON object.
I'm thinking tables may be a key but I'm unsure if I'm reinventing the wheel here.
As always, any help would be greatly appreciated. Thanks in advance.
Strings in MongoDB can store any special characters like line-breaks, tabs or multiple spaces. When you store some program sourcecode as a string in a document, it should look the same when you retrieve the document.
Well you'll need something to access the database and returns back that to the backbone.js client.
You can use a Node.JS server with the MongoDB Driver if you prefer javascript.
You may want to try some node.js packages such as Express and Mongoose.
If this is a small project, just to learn how everything works, that's ok. Otherwise you might want to consider looking into how to display only the Blog Text by backbone.js, and separating the View from the Data. So if you want to change the CSS or they style of the blog you don't need to update (every single blog post document on mongo)
I have a page where i keep getting data from a database periodically. That data is depicted as a graph. At each period, i want to update the graph with new data. Meaning that i dont want to replace the old graph, but extend it. For example,im using a line chart which is currently displaying. When new data comes in, i want the lines in the chart to extend to represent the new data, but the previous lines should remain as-is. Which JavaScript graphing API can provide this functionality ? Is it possible with Google Charts ?
Well, whether you like it or not, you're in the middle of writing a real-time web application process :D
Here are your solutions:
Pure javascript
If you're in the mood of using a library:
I highly recommend using APE library. as I said multiple times before, it's a robust framework for developing real-time web apps.
Another great solution is HTML5's websockets. it's awesome but not cross-browser.
If you're not in the mood of using a library:
You may send an AJAX request to your server periodically to check whether any updates are available for your data or not.
Using third party plugins
The easiest and the most common solution is Adobe Flash's XMLSocket APIs.
You may use Silverlight too, but you know, it doesn't worth it (development time I meant).
EDIT:
Oh, almost forgot to say, this style of programming (updating data without user's interaction/awareness) is called Comet programming, so if you need a keyword to search further on this subject use this one.
I agree with 3p3r, and can elaborate on library implementation.
A topic you may want to keep in mind is Data-Binding.
It is a process commonly employed by MVC systems such as backbone.js.
The notion is that the model(data) is automatically updated into the View when data changes are detected .
Data-Binding is not only available in MVC it is also available in graphing widgets for libraries like ExtJS. Using a library can greatly reduce your maintenance overhead in development and avoid commonly encountered complications.
Other libraries that may easily incorporate a data-binding process are: D3, HighCharts, and Raphael.
All the best!
Nash
I'm working on a project and there is some battle between how some JS filtering should be implemented and I would like to ask you guys some input on this.
Today we have this site that displays a long list of repeated entries of data and some JS filtering would be nice for the users to navigate through. The usual stuff: keyword, order, date, price, etc. The question is not the use of JS, which is obvious, but the origin of the data. One person defends that the HTML itself should be used and that the JS should parse through it making the user's desired filtering. Another person defends that we should use a JSON generated in the server, and that JSON should be the data's origin.
What you guys think on this? What are the pros and cons?
As a final request, I would like you to be the most informative as possible since your answers will be used and referenced for all us in the company. (Yes, that is how we trust you!:)
The right action is matter of taste and system architecture as well as utility.
I would go with dynamically generated pages with JS and JSON -- These days I think you can safely assume that most browsers has Javascript enabled -- however you may need to make provisions for crawler (GoogleBot, Bing, Ask etc) as they may not fully execute all JS and hence may not index the page if you do figure out some kind of exception for supporting those.
Using JS+JSON also means that you make your code work so that support for mobile diveces is done client side, without the webserver having to create anything special.
Doing DOM manipulation as the alternative would not be my best friend, as the logic of the page control and layout is split-up in two places -- partly in the View controller on the webserver, and partly in the JavaScript -- it is in my opinion better to have it in one place and have the view controller only generate JSON and server the root pages etc.
However this is a matter of taste, and im not sure that I would be able to say that there is one correct and best solution.
I think it's a lot cleaner if the data is delivered in JSON and then the presentation HTML or view of that data is generated from that JSON with javascript.
This fits the more classic style of keeping core data structures separate from views. In this manner you can generate all types of views without having to constantly munge/revise the way you store, access and manipulate the data. You can even build classes and methods to develop a clean interface on your data that is entirely independent of how that data is displayed.
The only issue I see with that is if the browser doesn't support javascript and that browser is a desired viewer. In that case, you have to include a default HTML version from the server that will obviously not be manipulated and the JSON will be ignored.
The middle ground is that you include both JSON and the "default", initial HTML view of that data in rendered HTML. The view comes up quickly and non-JS browsers can see something useful. But, then any future manipulation of the view (sorting, for example) uses the JSON data and generates a new clean view from the JSON data. No data is then ever "parsed" from the HTML view.
In larger projects, this also can facilitate the separation of presentation from data manipulation so different people may work on creating HTML views vs. manipulate the data (like sorting).
I would make the multiple ajax calls to the server and have it return the sorted/filtered data. If you server backend is fast than it won't be very taxing and you could even cache the data between requests.
If you only have 50-100 items than it would be reasonable to send it all to the client and have javascript sort and filter it.
Some considerations to help make the decision
Is the information sensitive and unique? (this voids and benefit to caching in my first point)
What is the most common request that will happen and are you optimizing for that?
How much data is there? (tens of rows, hundreds, thousands, millions)?
Does you site have to work with JavaScript turned off? (supporting older browsers?)
Is your development team more comfortable doing this in the front-end or back-end?
The answer is that it depends on your situation.