10void MakeTCanvasJS(
const char *MacroName,
const char *IN,
const char *OutDir,
bool cp,
bool py,
bool aclic)
33 std::vector<TString> json_codes;
40 fprintf(fh,
"<center>\n");
44 fprintf(fh,
" <div id=\"draw_pict%d_%s\" style=\"position: relative; width: %dpx; height: %dpx;\"></div>\n",
45 ImageNum,IN,
canvas->GetWindowWidth(),
canvas->GetWindowHeight());
47 fprintf(fh,
"</center>\n");
49 fprintf(fh,
"<script type=\"module\">\n");
50 fprintf(fh,
" import { settings, parse, draw } from './js/modules/main.mjs';\n");
51 fprintf(fh,
" settings.HandleKeys = false;\n");
52 for (
int i=1; i<=ImageNum; i++) {
53 fprintf(fh,
" let obj%d = parse(%s);\n", i, json_codes[i-1].Data());
54 fprintf(fh,
" draw('draw_pict%d_%s', obj%d, \"\");\n", i,IN,i);
56 fprintf(fh,
"</script>\n");
void MakeTCanvasJS(const char *MacroName, const char *IN, const char *OutDir, bool cp, bool py, bool aclic)
Generates the root file output of the macro MacroName.
int Int_t
Signed integer 4 bytes (int).
@ kNoSpaces
no new lines plus remove all spaces around "," and ":" symbols
@ kSameSuppression
zero suppression plus compress many similar values together
const char * Data() const
TString & Remove(Ssiz_t pos)
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Ssiz_t Index(const char *pat, Ssiz_t i=0, ECaseCompare cmp=kExact) const
static TString CreateCanvasJSON(TCanvas *c, Int_t json_compression=0, Bool_t batchmode=kFALSE)
Create JSON painting output for given canvas Produce JSON can be used for offline drawing with JSROOT...