Comments (12)
@YanekR I'll see if I can figure it out.
from transform_vis.
I'll be supplying a more realistic example shortly
from transform_vis.
OK here we have a complete working example using ES data. There was a variable binding bug that had to be fixed to get this to work, so 6.2.2 was re-released:
https://github.com/PhaedrusTheGreek/transform_vis/blob/master/RECIPES.md#custom-d3
from transform_vis.
It is possible to import a library like this:
Javascript:
({
import_some_lib: function() {
$.getScript( "/path/to/script.js", function( data, textStatus, jqxhr ) {
console.log("Import Complete");
});
}
})
Mustache:
{{meta.import_some_lib}}
When I tested this, it worked, but there were some issues with resource paths that had to be hacked out.
from transform_vis.
yes, if we can import third party js lib in this plugin, which is really awesome
from transform_vis.
I recently pushed some changes so that this is also possible by using a <script>
tag inside the template like this:
<script src="http://www.site.com/some.min.js"/>
<script src="/path/to/some.js"/>
<script>
$('.myButton').doSomethingNew();
</script>
<a href=# class="myButton">Do It</a>
EDIT: This won't work anymore due to tighter security around XSS control. Use this method instead
from transform_vis.
awesome, which bring with more imagination for this plugin
from transform_vis.
@PhaedrusTheGreek Would you be able to create a small manual how to, as for me above solution does not work for both d3.js & chart.js lib's.
from transform_vis.
This is now possible as of some changes in 6.2.2. I added an after_render
function that is executed after the HTML is rendered, so that D3 might be able to select an element at that point.
I posted an example in the Javascript section of the docs
Also note that D3 is already included in the Kibana distrbution so it doesn't need to be imported. If it was necessary to import a library, you could use this method
from transform_vis.
@PhaedrusTheGreek could you please clarify how can I refer to the outcome of one function in other one? example below:
({
function_one: function() {
var object_one = [];
return object;
}
function_two: function() {
var object_two = function_one();
return object_two
}
})
Mustache Syntax example:
Will appreciate your help,
Yanek_R
from transform_vis.
It is possible to import a library like this:
Javascript:
({ import_some_lib: function() { $.getScript( "/path/to/script.js", function( data, textStatus, jqxhr ) { console.log("Import Complete"); }); } })
Mustache:
{{meta.import_some_lib}}
When I tested this, it worked, but there were some issues with resource paths that had to be hacked out.
what I found it it will throw exception and says can not found the lib...something like this while log out and re-login Kibana:
TypeError: $(...).CanvasJSChart is not a function (http://tdexample01:6789/bundles/commons.bundle.js line 22 > eval:42)
Version: 6.4.4-SNAPSHOT
Build: 18067
Error: TypeError: $(...).CanvasJSChart is not a function (http://tdexample01:6789/bundles/commons.bundle.js line 22 > eval:42)
window.onerror@http://tdexample01:6789/bundles/commons.bundle.js:12:869171
from transform_vis.
now my solution is just add the third party js lib into the project dependency and declare it in the response handler js code.
I have successed to add plotly.js as my js lib, then we never need to manual import it in the js template.
from transform_vis.
Related Issues (20)
- Possibility of using style-tags HOT 2
- can this plugin have a pagination? HOT 2
- Can one perform queries on multiple indices with this plugin? HOT 1
- Kibana 5.4.1 HOT 2
- Can we pass the output of the query/ JS/ template to an existing visual HOT 3
- Is there a way to access the object returned by function in Javascript box directly inside <script> tag in Template section HOT 2
- Index Pattern Incorrect HOT 1
- How about a plan for Kibana 6.0.0 ? HOT 2
- Support for Kibana 5.6.2 HOT 2
- Update to 6.1.2 HOT 2
- Transform_vis_6.0.0 support for Kibana 6.0.1 HOT 1
- Can not see JS input window HOT 2
- Bug with importing third party JS
- Plugin not supporting in Kibana version 6.2.3 HOT 1
- Support multiple index queries HOT 2
- 6.4.0 No index pattern HOT 3
- Error with 6.4.2
- revision up to support kibana 7.x version
- upgrade transform-vis for kibana 6.8.0
- Please update the great plugin to 7.*
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 transform_vis.