highcharts-export-server does not finish - node.js

I have highcharts-export-server v2.1.0 (which uses phantomjs v.2.1.1) configured on 2 servers.
Problem: One server can produce a chart from my "test" .json to .svg, the other server cannot / seems stuck...
Question: I have already set the logLevel to 4, How else can I debug this / find the error?
.
My input script is the following:
{"title":{"text":"Benchmark +0.75% (Year to Date)"},"time":{"useUTC":false},"chart":{"alignThresholds":true,"width":1000,"height":400,"plotBackgroundColor":null,"plotBorderWidth":0,"plotShadow":false,"spacingRight":40},"xAxis":{"labels":{"rotation":-45}},"yAxis":[{"labels":{"format":"{value:.0f}"},"showLastLabel":true,"opposite":false,"min":-3.67256505,"max":4.93075599694519,"tickPositions":[-3.67,-2.6,-1.52,0,0.63,1.7,2.78,3.86,4.93]},{"showLastLabel":true,"gridLineWidth":0,"tickPosition":"outside","labels":{"align":"right","x":30,"style":{"color":"#ff0000"}},"min":-0.9340809915870241,"max":1.2540895500000002,"tickPositions":[-0.93,-0.66,-0.39,-0.11,0,0.16,0.43,0.71,0.98,1.25]}],"legend":{"enabled":true},"rangeSelector":{"enabled":false},"scrollbar":{"enabled":false},"navigator":{"enabled":false},"credits":{"enabled":false},"plotOptions":{"series":{"compare":"percent","showInNavigator":false}},"series":[{"compare":"amount","data":[[1609282800000,0],[1609369200000,-0.03428646532872559],[1609455600000,-0.0016039750283303178],[1609714800000,0.7637526405996908],[1609801200000,0.8005732883660022],[1609887600000,-0.1690494144598209],[1609974000000,-0.3809350266101741],[1610060400000,-1.514325071693856],[1610319600000,-0.4765023006985114],[1610406000000,-0.20592306146072215],[1610492400000,-1.6056700749591757],[1610578800000,-2.283907756098269],[1610665200000,-2.8475657141212585],[1610924400000,-2.5301565339659216],[1611010800000,-1.347913879404139],[1611097200000,-1.078254441804205],[1611183600000,-1.508647334728952],[1611270000000,-1.5661224299388987],[1611529200000,-2.280813980426055],[1611615600000,-1.9904069262878465],[1611702000000,-3.1733261828598924],[1611788400000,-2.6038661425901943],[1611874800000,-3.10474672552985],[1612134000000,-1.9489382228070617],[1612220400000,-1.4168123948971045],[1612306800000,-1.5077205238559155],[1612393200000,-1.114743473256452],[1612479600000,-1.445007216058669],[1612738800000,-1.2708019773828516],[1612825200000,-1.5637751417799883],[1612911600000,-0.9207988194119499],[1612998000000,-0.5330477534657541],[1613084400000,-1.3483873661346957],[1613343600000,-1.2824277237734494],[1613430000000,-0.8192853328358063],[1613516400000,-0.3653079990091568],[1613602800000,-0.060653517166342485],[1613689200000,0.8697340876174797],[1613948400000,1.2280953226873725],[1614034800000,1.0859394764373809],[1614121200000,1.2063367293352778],[1614207600000,0.10773414212172927],[1614294000000,-1.5207190905506263],[1614553200000,-0.9816998314673975],[1614639600000,-0.924383129032802],[1614726000000,-0.8715904396361718],[1614812400000,-0.4280745420743859]],"name":"Portfolio -0.43%"},{"compare":"amount","data":[[1609282800000,0],[1609714800000,0.8278755650112268],[1609801200000,0.7356135496841887],[1609887600000,-0.3448445224439989],[1609974000000,-0.5651564695949629],[1610060400000,-1.6946417469431263],[1610319600000,-0.6017716353404978],[1610406000000,-0.302437374178699],[1610492400000,-1.6516136459999498],[1610578800000,-2.459423156169538],[1610665200000,-2.696698045145274],[1610924400000,-2.410809781870449],[1611010800000,-1.3613816021318614],[1611097200000,-0.991919709902811],[1611183600000,-1.414545878781237],[1611270000000,-1.4817771059954743],[1611529200000,-2.3322008861873744],[1611615600000,-2.036590278127237],[1611702000000,-3.4976807891963],[1611788400000,-2.986102839764737],[1611874800000,-3.4540325607614886],[1612134000000,-2.105269707267987],[1612220400000,-1.5899676921416361],[1612306800000,-1.7726301025414615],[1612393200000,-1.5556279775712611],[1612479600000,-1.7695269895245613],[1612738800000,-1.655544008265486],[1612825200000,-1.93170951416185],[1612911600000,-1.2587762893416121],[1612998000000,-0.8789710996493616],[1613084400000,-1.718017623965562],[1613343600000,-1.6160328512600741],[1613430000000,-1.1553433147096226],[1613516400000,-0.8357362895423104],[1613602800000,-0.5901872577077749],[1613689200000,0.4652404389007492],[1613948400000,0.7387166627010888],[1614034800000,0.6296984147131646],[1614121200000,0.597220732990178],[1614207600000,-0.45944804378783566],[1614294000000,-1.952809940009137],[1614553200000,-1.430060618679485],[1614639600000,-1.3313860807479094],[1614726000000,-1.3636570533070103],[1614812400000,-1.622445786457749],[1614898800000,-1.5049462738540242],[1615158000000,-1.1762370313930126]],"name":"BENCHM REF -1.18%"},{"data":[[1609282800000,0],[1609714800000,-0.064122924411536],[1609801200000,0.06495973868181348],[1609887600000,0.17579510798417797],[1609974000000,0.18422144298478882],[1610060400000,0.1803166752492702],[1610319600000,0.12526933464198642],[1610406000000,0.09651431271797684],[1610492400000,0.04594357104077407],[1610578800000,0.17551540007126887],[1610665200000,-0.1508676689759847],[1610924400000,-0.11934675209547274],[1611010800000,0.013467722727722453],[1611097200000,-0.08633473190139407],[1611183600000,-0.09410145594771491],[1611270000000,-0.08434532394342442],[1611529200000,0.05138690576131921],[1611615600000,0.046183351839390596],[1611702000000,0.3243546063364078],[1611788400000,0.3822366971745428],[1611874800000,0.3492858352316386],[1612134000000,0.15633148446092537],[1612220400000,0.1731552972445316],[1612306800000,0.264909578685546],[1612393200000,0.4408845043148091],[1612479600000,0.3245197734658922],[1612738800000,0.38474203088263437],[1612825200000,0.3679343723818618],[1612911600000,0.33797746992966227],[1612998000000,0.34592334618360754],[1613084400000,0.36963025783086634],[1613343600000,0.33360512748662474],[1613430000000,0.3360579818738163],[1613516400000,0.4704282905331536],[1613602800000,0.5295337405414324],[1613689200000,0.40449364871673055],[1613948400000,0.4893786599862837],[1614034800000,0.4562410617242163],[1614121200000,0.6091159963450998],[1614207600000,0.5671821859095649],[1614294000000,0.43209084945851073],[1614553200000,0.4483607872120876],[1614639600000,0.4070029517151075],[1614726000000,0.4920666136708385],[1614812400000,1.1943712443833632]],"color":"#ff0000","name":"Relative Performance +0.75%","yAxis":1,"compare":"amount","dashStyle":"ShortDash"}]}
This is the code I use to produce the .svg file
/opt/mx/reports/node_modules/highcharts-export-server/bin/cli.js -infile /opt/mx/reports/js/_testcases/stock.json -outfile /tmp/_teststockchart.svg -type svg -constr StockChart --logLevel 4
This is the .svg being produced:

Related

\DeclareSymbolFont Not working with Ankiweb app

I am attempting to use math symbols that don't exist by default as part of existing packages in Options for notes (eg. amsmath). I tested the below code in TeXworks (pdfLaTeX) with no issues.
\DeclareSymbolFont{matha}{OML}{txmi}{m}{it}% txfonts
\DeclareMathSymbol{\varv}{\mathord}{matha}{118}
...
$ \varv = 0 $
Upon adding the \DeclareSymbolFont... and \DeclareMathSymbol... lines to
Tools => Manage Note Types => Options, and inserting the lines before \begin{document}, I tried below lines in Ankiweb app Card
\( \varv = 0 \) or [$] \varv = 0 [/$],
but ankiweb app doesnt convert this to the right symbol as it does with TeXworks
Is there something I need to do specifically? Or is the above steps not allowed in Ankiweb app.
Ankiweb app details:
Version ⁨2.1.54 (b6a7760c)⁩
Python 3.9.7 Qt 5.15.2 PyQt 5.15.5

Synchronous pymol

I am trying to load an mrc file, generate the map of it and then save the image, the problem is that it only saves a blank image, the code I run is the following:
from pymol import cmd
cmd.load('./6vof.mrc', ' 6vof')
cmd.volume( '6vof _volume', ' 6vof')
cmd.png('./test.png', 300, 200)
The equivalent code in the interface does work, I wanted to know how I can make the save method wait for the rendering of everything.
Hi Luis José Castillo,
it seems I encountered the same problem as you did.
I wanted to use Pymol from within a Ruby on Rails application and always got his message, when I launched it from within ruby:
CmdLoad: "mypol/4hhb.pdb" loaded as "4hhb".
Ray: render time: 0.02 sec. = 178776.9 frames/hour (0.02 sec. accum.).
The result was a blank transparent png. If I ran it in the command line with the same script I got this message and a perfect png:
CmdLoad: "4hhb.pdb" loaded as "4hhb".
Ray: render time: 4.04 sec. = 890.8 frames/hour (4.04 sec. accum.).
I got this behavoir on Ubuntu 20, Ubuntu 18 Server and in Docker.
I figured out, that the only difference was, I used relative paths from within ruby, but was always running everything in the same folder in the command line.
Well, so I just make this detour for my Rails application and now it does work:
def get_protein_image(pdb_id)
dir_path = get_pdb_file(pdb_id)
`cp lib/png_from_pdb.py #{dir_path} && cd #{dir_path} && pymol protein.pdb png_from_pdb.py -qc`
end
Sorry for the ruby code here, but here the essential solution, try to run everything inside the same folder (I simply delete the tmp subfolder after png generation).
cp lib/png_from_pdb.py #{dir_path} && cd #{dir_path} && pymol protein.pdb png_from_pdb.py -qc
I hope this trick will help you too!
Best regards,
Stephan

Is there any way to extract a rar file on cpanel

I have a website script, it 212MB and it's in RAR format , I could not upload it via filezilla ftp , it gave me a timeout error after sometime, I could not upload it from the filemanager of cpanel as it also kept showing an error. Then I used a php script to upload it directly from the link but now I can not extract it as its RAR not ZIP. I converted the RAR into ZIP and have it on drop box and google drive but there is no direct link which I can use to upload via the php script, SO, Is there any way to extract the rar file from cpanel or using a php script or some other tweak. I have been working on it for 2 hours now and can not find a way around.
create a php file and extra the .rar with that php file. use the following code
$archive = RarArchive::open('archive.rar');
$entries = $archive->getEntries();
foreach ($entries as $entry) {
$entry->extract('/extract/to/this/path');
}
$archive->close();

Linux and apache tika issue

Im using tika-app.jar with the version 1.12,to try to find the list of corrupted files that can't be opened in a specified folder.
the problem is when i tested inside windows it gives me in the log folder some exception that allow me to know what files that can't be opened like this :
Caused by: org.apache.poi.openxml4j.exceptions.InvalidOperationException: Can't open the specified file: 'folder\mi-am-CV.docx'
but the problem in linux is only i get a broad error in the log folder like this:
WARN org.apache.tika.batch.FileResourceConsumer - <parse_ex resourceId="test-corrupted-2.doc">org.apache.tika.exception.TikaException: Unexpected RuntimeException from org.apache.tika.parser.microsoft.OfficeParser#f6e9bd4
so i can't know specificaly what files that are really corrupted and can't be opened.
here's the shell command that i use for that in linux :
java -Dlog4j.debug -Dlog4j.configuration=file:log4j_driver.xml -cp "bin/*" org.apache.tika.cli.TikaCLI -JXX:-OmitStackTraceInFastThrow -JXmx5g -JDlog4j.configuration=file:log4j.xml -bc tika-batch-config-basic-test.xml -i /folder -o outxml -numConsumers 10
thanks.

How to deliver a node.js + imagemagick tool?

I've developed a node.js tool which uses imagemagick from the command line. That is, exec('my_imagemagick_commands'). What's the best way to deliver that tool to a client using Windows? That is, how can I make a Windows installer that'll install node.js, imagemagick and the tool - preferably as a binary, not the source - in a specific folder?
If you want an easy bundle... Zip the list below, deploy on client and drag/drop images to be processed onto the yourtool.cmd file (I'm doing something similar for image optimizers)
Bundle: (put these in one directory)
yourtool.cmd
yourtool.js
node.exe
node_modules/ (if applicable)
yourtool.cmd
REM Get the drive/path the batch file is in
set batchdir=%~d0%~p0
REM Run tool for items dragged over...
"%batchdir%node.exe" "%batchdir%yourtool.js" %*
yourtool.js
// start at 2 for arguments passed...
// 0 is node.exe
// 1 is the js file run
for (var i=2; i<process.argv.length; i++) {
var imagePath = process.argv[i];
//do something with image...
}
For others interested in imagemagick with node, you should check out node-imagemagick

Resources