Module:Graph:Chart: Difference between revisions
Appearance
Content deleted Content added
MusikBot II (talk | contribs) m Protected "Module:Graph:Chart": High-risk template or module (more info) ([Edit=Require autoconfirmed or confirmed access] (indefinite)) |
looks safe to remove that per tfd |
||
Line 23: | Line 23: | ||
end |
end |
||
}) |
}) |
||
return frame:extensionTag |
return frame:extensionTag('graph', graph.chartWrapper(newFrame)) |
||
frame:extensionTag('graph', graph.chartWrapper(newFrame)) |
|||
end |
end |
||
Latest revision as of 22:32, 10 June 2023
Usage
This module simulates {{Graph:Chart}} but with a lower post-expand include size. Use it on articles with large numbers of graphs or that are approaching the PEIS limit. It can also be used in other templates or modules.
Follow documentation for the main template, but replace {{Graph:Chart
with {{#invoke:Graph:Chart|
(note the extra vertical bar), and it should work exactly the same way.
local p = {}
local graph = require('Module:Graph')
p[''] = function(frame)
local newFrame = {
getParent = function(self)
return frame
end,
getTitle = function(self)
return 'Template:Graph:Chart'
end,
args = {}
}
setmetatable(newFrame, {
__index = function(t, k)
if type(frame[k]) == 'function' then
return function(...)
return frame[k](frame, select(2, ...))
end
else
return frame[k]
end
end
})
return frame:extensionTag('graph', graph.chartWrapper(newFrame))
end
return p