Modulo:Graph: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
aggiorno |
m correggo |
||
(3 versioni intermedie di uno stesso utente non sono mostrate) | |||
Riga 31:
if #errors > 0 then
local out = string.format('<strong class="error">%s</strong>', table.concat(errors, "; "))
if nocat or not cfg.uncategorized_namespaces[mw.title.getCurrentTitle().
out = out .. '[[Category:' .. cfg.errors_category .. ']]'
end
Riga 456:
end
-- Color scale
local colorScale = {
name = "color", type = "ordinal", range = args.colors }
local alphaScale
if args.alphas then alphaScale = { name = "transparency", graph_type = "ordinal", range = args.alphas } end
-- Symbols scale
local symbolsScale
if type(args.symbols)
symbolsScale = { name = "symShape", type = "ordinal", range = end -- for bar charts with multiple series: each series is grouped by the x value, therefore the series need their own scale within each x group
local groupScale
Line 536 ⟶ 543:
shape = { scale = "symShape", field = "series" },
stroke = { scale = "color", field = "series" },
▲ fill = { scale = "color", field = "series" },
},
}
Line 542 ⟶ 548:
if args.symbol_size then symbolsMarks.properties.enter.size = { value = args.symbol_size } end
if alphaScale then
end
end
Line 667 ⟶ 673:
-- is not to use symbol.
if chart_arg.graph_type == "line" and not args:is_no('symbols') then
chart_arg.symbols = stringArray(args:value('symbols'
chart_arg.symbol_size = args:number('symbolSize', cfg.default.symbol_size)
end
Line 752 ⟶ 758:
end
local chart = frame:extensionTag('graph', chart_json)
local align = args
return wrap_graph(chart, external_legend, align, chart_arg.graphwidth) .. errors_output(args:value('NoTracking'))
end
Line 771 ⟶ 777:
___domain = { data = "highlights", field = "v" },
range = args.colorScale,
nice = true,
zero = false
}
}
|