I configured HighCharts on our Zeppelin Tool to implement a drill down functionality.
We placed the below jar files and stated the same in the Dependencies
Zeppelin-highcharts-0.6.4.jar
lift-json_2.11-2.6.3.jar
paranamer-2.4.1.jar
We tried executing the below code-
val bank = spark.read.option("header",true).csv("/u01/zepplin/bank/bank2.csv")
bank.show()
+---+-------+
|age|balance|
+---+-------+
| 20| 40000|
| 30| 60000|
| 50| 70000|
| 80| 90000|
+---+-------+
import com.knockdata.spark.highcharts._
import com.knockdata.spark.highcharts.model._
highcharts(bank.series("x" -> "age", "y" -> sum(col("balance"))).orderBy(col("age"))).plot()
But this code is not able to plot anything, giving a blank out put.It just shows the tile(Chart Title).
To rule out the browser compatibility issue I tried this on all the browsers too.
Am I missing something here.Do we have any alternative for High-charts for custom visualization like drill down etc.
Thanks in Advance
Related
I'm using the nativescript-google-maps-utils plugin in a NativeScript JavaScript project to access GoogleMapsUtils functions (GMSGeometryDistance, GMSGeometryInterpolate, and GMSGeometryHeading) so that I can traverse a polyline. The Android equivalents work fine on Android devices, and the iOS functions listed work on an iOS simulator, but on an iOS device I get the exception,
ReferenceError: Metadata for "GoogleMaps.GMSGeometryDistance" found but symbol not available at runtime.
I've been chasing this for the better part of a day and still don't have any leads; I'd welcome any insight.
[edit]
It's worth mentioning I've done the usual removal of the platforms, hooks, and node-modules folders and rebuilt, with no change in the error.
Here's the first line of code that triggers the error:
let lineDistance = GMSGeometryDistance(latlngs[i], latlngs[i + 1]);
[edit 2]
Still chasing this... I gather from this issue that I need to create a file with a list of exported symbols, and this issue kind of suggests how that could be done, but I'm not understanding how that applies to this situation.
That is, the question at hand now is how can I determine the symbols from the iOS GoogleMapsUtils static library? This is becoming more of an iOS and Xcode question that NativeScript or JavaScript.
[edit 3]
Sigh... I did get this working using the answer I provided below, but now that same approach is no longer working. No idea why :-(
[edit 4]
I re-reviewed the links I referenced above and included the STRIPFLAGS option and now the code works properly. I revised the answer to include this, and to edit build.xcconfig rather than the project file.
After another day's investigation I was able to get this working. Here's what it took.
Navigate to /platforms/iOS/Pods/GoogleMaps/Maps/Frameworks/GoogleMaps.framework/
Run nm --defined-only GoogleMaps | grep " T " | cut -f 3 -d' ' | egrep -v '^$|GoogleMaps'
Notice the names of the symbols. In my case each one I needed was the function name prefixed with an underscore
Create the file exportedSymbols.txt in /app/App_Resources/iOS
Add the symbols to the file. In my case the contents is:
_GMSGeometryDistance
_GMSGeometryHeading
_GMSGeometryInterpolate
Edit the file app/App_Resources/iOS/build.xcconfig and add these two lines
STRIPFLAGS=$(inherited) -s {PROJECT_DIR}/../../app/App_Resources/iOS/exportedSymbols.txt
EXPORTED_SYMBOLS_FILE = ${PROJECT_DIR}/../../app/App_Resources/iOS/exportedSymbols.txt
So far this is working in my tests on both iOS simulators and devices.
I have Google Maps polygons stored as polygons in Postgres and I read them straight from DB to output to a react Component for editing using the Google Maps API.
In my local dev environment this works fine and by inspecting the data being fed to the React component everything looks normal:
this.state = {
map: "POLYGON ((10.69332405332034 59.88086121809927, 10.77572151425784 59.84569766552776, 10.81554695371096 59.84121336506844, 10.8450727105469 59.84518027707294, 10.86910530332034 59.85397478713949, 10.91442390683596 59.88499566305687, 11.020510637793 59.9383527020427, 10.99115654233401 59.96809210273585, 10.91811462644046 59.99462872670429, 10.80250068906253 60.0067306049673, 10.58723732236331 59.97273110496651, 10.43772026303714 59.86724837030302, 10.44239803555911 59.85643166134471, 10.44501587155..."
}
But in production it seems some kind of compression/encoding is taking effect, rendering the data unusable to Google Maps:
this.state = {
map: "01030000000100000011000000004DF44CCD71164029B0493D19844D40004DF44C45AE1640E4A03B36D6814D40004DF44C75D81640139E06594D7F4D40004DF44C7532174001AC3D1CC47C4D40004DF44CAD0917404808CC83B0774D40004DF44CB5101740926DE6EDB2714D40004DF44C45081740393029BE276E4D40004DF44C8513174013D62165106C4D40004DF44C2DF31640637589D49B6A4D40004DF44CBD901640E794678CCA6B4D40004DF44C5535164080F6C4D4E16B4D40004DF44CCD17164099584C2D84724D40004DF44C553516400505C70B53784D40004DF44C1D31164037A2643EC17F4D40004DF44CC53D1640F4139BEDEA"
}
Background/environment
We recently had to take a server out of service and in its place we added two new ones to the load balancer. They were set up through Cloud 66 using the same config so they should be exaclty the same, but I guess you never know.
We use slim syntax for templates.
I should clarify: Nothing is being done explicitly by our application code to the map field on its way from Postgres to the React component. We get the database record like so: #coverage_map = CoverageMap.find(params[:id]) and then output it in the template like so: coverageMap: #coverage_map. The outputted data on display here is copied from the HTML template being rendered by Slim.
What could be happening here? Any tips on what to look for?
In your dev environment you're retrieving the geometry from the database as WKT (Well Known Text), which is not PostgreSQL's standard output. In production you're getting a WKB (Well Known Binary) representation of the geometry, which is what you normally see when firing a simple select. What you need is to use ST_AsText to get your WKT, e.g.
WITH mytable (geom) AS (
VALUES ('POINT(1 1)'::geometry)
)
SELECT geom,ST_AsText(geom) FROM mytable;
geom | st_astext
--------------------------------------------+------------
0101000000000000000000F03F000000000000F03F | POINT(1 1)
(1 Zeile)
I am running into a very unique edge case with my TinyMCE user experience.
I want to be able to
COPY IMAGE (Right click, copy image on any image on the internet)
PASTE IMAGE (CTRL + V) into TinyMCE editor
and have it save a local copy of this image and serve that.
The problem is a user can paste an image being served in S3 bucket and it is only authenticated for a certain amount of time, then days later the image will not show.
I have looked at TinyMCE - File Image Upload documentation to no avail.
Also looked into TinyMCE Paste Plugin, TinyMCE Local Upload Demo, TinyMCE Docs - Upload Images and dated gem TinyMCE-Rails-ImageUpload
Ultimately, I have a feeling that a custom handler for Paste Preprocess will need to be used
My tinymce.yml configuration follows:
menubar: false
statusbar: false
branding: false
toolbar:
- styleselect | bold italic underline strikethrough | indent outdent | blockquote | image | link | codesample | bullist numlist | table | code | undo redo
plugins:
- link
- codesample
- image
- lists
- code
- table
images_upload_url: "/tinymce_assets"
automatic_uploads: true
relative_urls: false
remove_script_host: false
convert_urls: true
table_responsive_width: true
I feel like this type of problem should be common and there should be a simple solution that I am not seeing. However, if not at all possible, would the solution be to create a custom js function that intercepts paste call, check if it is coming from external url, then decide to create a local image copy and give that url?
Thank you, and any help would be appreciated.
I want to cite inside Wikipedia sources which are stored in my JabRef Database. According to the jabref-documentation I need a custom exportfilter which is a file like
wikipediacitation.layout. This layout file converts a JabRef database into the wikipedia-syntax for pasting it at the end of an article. The description of the output format is given here. My problem is, that the creation of a Jabref-layout-file seems to be complicated. Can anybody help?
I've found the answer by myself.
The following files have to be created:
wikicite.layout:
<ref name=\bibtexkey>{{cite journal
| author = \author
| title = \title
| year = \year
| journal = \journal
| volume = \volume
| pages = \pages
| url = \url
}}</ref>
wikicite.begin.layout:
==References==
<references>
wikicite.end.layout
</references>
Then, a new export filter has to be added into Jabref (options -> manage custom exports -> add new). But even I've found myself the answer, thanks to Stackoverflow for listening to my problem.
I am trying to build a library that currently has the following structure
lib
| src (contains some internal .dart files)
| | private_parts.dart
| strategies (contains sample strategies for applications)
| | scoring.dart
| | time.dart
| mylib.dart (the main library file to include)
My problem occurs when I try to write an application that uses the sample strategies. I get the error/warning The imported libraries 'scoring.dart' and 'time.dart' should not have the same name ''.
My main file looks something like this (placed in the web folder)
import 'package:mylib/mylib.dart';
import 'package:mylib/strategies/scoring.dart';
import 'package:mylib/strategies/time.dart';
main() {
game = new Engine(new StandardTime(), new StandardScoring());
}
How should I restructure the library to make it correct? What is best practice?
Your code doesn't show a library directive so I suppose more than one library has the library name 'NONE'.
Add a library directive at the top of your dart source file
library my_library.my_sublibrary; // <= this should differ for each library
In dart each source file is a library as long as you don't add
part of some_library
instead of the library directive. Adding no library or part of directive makes it implicitely a library without a name.