Module:Infobox/Composé chimique
Apparence
[voir] [modifier] [historique] [purger]
Cette page définit un module d'infobox. Pour les conseils sur l'usage de ce module, voyez Modèle:Infobox Composé chimique.
La documentation de ce module est générée par le modèle {{Documentation module}}.
Elle est incluse depuis la page Modèle:Documentation module d'infobox. Veuillez placer les catégories sur cette page-là.
Les éditeurs peuvent travailler dans le bac à sable (créer).
Voir les statistiques d'appel depuis le wikicode sur l'outil wstat et les appels depuis d'autres modules.
local helper = require "Module:InfoboxBuilder/Helpers"
function dispNFPA704( )
local wikidata = require "Module:Wikidata"
local data
local valHealth = wikidata._formatStatements({property= 'P993'})
local valFire = wikidata._formatStatements({property= 'P994'})
local valReactivity = wikidata._formatStatements({property= 'P995'})
local valOther = wikidata._formatStatements({property= 'P877'})
res = ''
if valFire and valFire ~= '' then
if valFire == '0' then
textFire = 'Produit incombustible.'
elseif valFire == '1' then
textFire = 'Produit ne pouvant s\'enflammer qu\'après chauffage.'
elseif valFire == '2' then
textFire = 'Produit qui ne peut s\'enflammer qu\'après un chauffage modéré ou une exposition à une source de chaleur relativement élevée. Point d\'éclair compris entre 38 °C et 93 °C.'
elseif valFire == '3' then
textFire = 'Liquides et solides susceptibles de s\'enflammer à température ambiante. Point d\'éclair compris entre 38 °C et 23 °C.'
elseif valFire == '4' then
textFire = 'Produit susceptible de se vaporiser rapidement ou complètement à température et pression ambiantes, ou de se disperser dans l\'air et de s\'enflammer facilement. Point d\'éclair inférieur à 23 °C.'
else
textFire = '? [[Catégorie:Valeur Wikidata inattendue]]'
end
res = res .. '<div style="width: 75px; height: 2em; text-align: center; vertical-align: middle; position: absolute; top: 12px; font-size: large;"><span style="color: black;" title="' .. textFire .. '">' .. valFire ..'</span></div>'
end
if valHealth and valHealth ~= '' then
if valHealth == '0' then
textHealth = 'Produit non toxique, pouvant être utilisé sans précautions particulières.'
elseif valHealth == '1' then
textHealth = 'Produit pouvant provoquer après une exposition une irritation ou des séquelles mineures.'
elseif valHealth == '2' then
textHealth = 'Produit pouvant provoquer après une exposition intense ou continue (mais non chronique), une incapacité temporaire ou une séquelle mineure résiduelle.'
elseif valHealth == '3' then
textHealth = 'Produit pouvant provoquer après une exposition de courte durée, des séquelles graves temporaires ou bien des séquelles modérées résiduelles.'
elseif valHealth == '4' then
textHealth = 'Produit pouvant provoquer après une exposition de très courte durée, un décès ou des séquelles graves.'
else
textHealth = '? [[Catégorie:Valeur Wikidata inattendue]]'
end
res = res .. '<div style="width: 37.5px; height: 2em; text-align: center; vertical-align: middle; position: absolute; top: 30px; font-size: large;"><span style="color: black;" title="' .. textHealth .. '">' .. valHealth .. '</span></div>'
end
if valReactivity and valReactivity ~= '' then
if valReactivity == '0' then
textReactivity = 'Produit généralement inerte.'
elseif valReactivity == '1' then
textReactivity = 'Produit stable, mais pouvant devenir instable à température et pression élevées.'
elseif valReactivity == '2' then
textReactivity = 'Produit pouvant subir une transformation chimique violente à température et pression élevées, ou susceptible d\'exploser au contact de l\'eau, ou de former un mélange explosif avec de l\'eau.'
elseif valReactivity == '3' then
textReactivity = 'Produit pouvant détoner ou exploser, mais nécessitant une forte source d\'allumage, ou un chauffage important en milieu confiné, ou susceptible d\'exploser au contact de l\'eau, ou capable d\'exploser par un choc important.'
elseif valReactivity == '4' then
textReactivity = 'Produit pouvant détoner ou exploser à température et pression ambiantes.'
else
textFire = '? [[Catégorie:Valeur Wikidata inattendue]]'
end
res = res .. '<div style="width: 37.5px; height: 2em; text-align: center; vertical-align: middle; position: absolute; top: 30px; left: 37.5px; font-size: large;"><span style="color: black;" title="' .. textReactivity .. '">' .. valReactivity .. '</span></div>'
end
if valOther and valOther ~= '' then
res = res .. '<div style="width: 75px; height: 2em; text-align: center; vertical-align: middle; position: absolute; top: 49px; font-size: small;">' .. valOther .. '</div>'
end
if res ~= '' then
res = '<div style="position: relative; height: 85px; width: 75px;margin: 0 auto"><div style="position: absolute; height: 75px; width: 75px;">[[Image:NFPA 704.svg|75px|Symbole NFPA 704]]</div>' .. res .. '</div>'
end
return res
end
styleH = 'background: #EEEEEE; border: 1px solid white; text-indent: 3px'
return {style = 'float: right; clear: right; margin: 0 0 0.5em 1em;', --" class="toccolours" border="0" cellpadding="1" align="right" width="280',
-- style = {float= 'right', clear= 'right', margin= '0 0 0.5em 1em', width= '280em', border= '0', cellpadding= '1', align= 'right'},
class = '', --'drugInfoBox_infobox_v2',
parts = {
helper.title(nil, '#ffdead', 'nom'),
{
type = 'images',
images = {
{
params = 'images'
}
},
legendParams = 'legende'
},
helper.table_n{ text = 'Identification', background = '#ffdead',
{ helper.mixed_n{label = '[[Dénomination commune internationale|DCI]]', params = 'DCI', styleHeader = styleH},
helper.mixed_n{label = '[[Nomenclature IUPAC|Nom IUPAC]]', params = 'nomIUPAC', styleHeader = styleH},
helper.mixed_n{label = '[[Numéro CAS|N° CAS]]', params = 'CAS', property = 'p231', styleHeader = styleH},
helper.mixed_n{label = '[[Numéro EINECS|N° EINECS]]', params = 'EINECS', property = 'p232', styleHeader = styleH},
helper.mixed_n{label = '[[Numéro RTECS|N° RTECS]]', params = 'RTECS', property = 'p657', styleHeader = styleH},
helper.mixed_n{label = '[[Classification anatomique, thérapeutique et chimique|Code ATC]]', params = 'ATC', property = 'p267', styleHeader = styleH},
helper.mixed_n{label = 'DrugBank', params = 'DrugBank', property = 'p715', styleHeader = styleH},
helper.mixed_n{label = '[[PubChem]]', params = 'PubChem', class = 'external text', property = 'p662', weblink = 'http://pubchem.ncbi.nlm.nih.gov/summary/summary.cgi?cid=', styleHeader = styleH},
helper.mixed_n{label = 'ChEBI', params = 'chEBI', property = 'p683', weblink = 'http://www.ebi.ac.uk/chebi/searchId.do?chebiId=', styleHeader = styleH},
helper.mixed_n{label = '[[Additif alimentaire|N° E]]', params = 'NrE', property = 'p628', styleHeader = styleH},
helper.mixed_n{label = '[[Generally recognized as safe|FEMA]]', params = 'FEMA', styleHeader = styleH},
helper.mixed_n{label = '[[Simplified Molecular Input Line Entry Specification|SMILES]]', params = 'SMILES', property = 'p233', hidden = 1, styleHeader = styleH},
helper.mixed_n{label = 'InChI', params = 'StdInChI', property = 'p234', hidden = 1, styleHeader = styleH},
helper.mixed_n{label = 'InChIKey', params = 'StdInChIKey', property = 'p235', hidden = 1, styleHeader = styleH},
helper.mixed_n{label = 'Apparence', params = 'apparence', styleHeader = styleH}
}
},
helper.table_n{ text = 'Propriétés chimiques', background = '#ffdead',
{ helper.mixed_n{label = '[[Formule brute]]', params = 'formule', property = 'p274', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Masse molaire]]', params = 'masseMol', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Constante_d\'équilibre#.C3.89quilibres_acido-basiques_:_KA.2C_KB|pKa]]', params = 'pKa', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Dipôle_électrostatique#Moment_dipolaire|Moment dipolaire]]', params = 'momentDipolaire', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Susceptibilité magnétique]]', params = 'susceptibiliteMagnetique', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Diamètre moléculaire]]', params = 'diametreMoleculaire', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Indice d’iode]]', params = 'indiceIode', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Indice d’acide]]', params = 'indiceAcide', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Indice de saponification]]', params = 'indiceSaponification', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
}
},
helper.table_n{ text = 'Propriétées physiques', background = '#f7efa8',
{ helper.mixed_n{label = '[[Température de transition vitreuse|T° transition vitreuse]]', params = 'TTransitionVitreuse', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Point de fusion|T° fusion]]', params = 'fusion', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Point d\'ébullition|T° ébullition]]', params = 'ebullition', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Solubilité]]', params = 'solubilite', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Polymère_en_solution#Approche de Hildebrand, paramètre de solubilité|Paramètre de solubilité δ]]', params = 'parametreSolubilite', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Masse volumique]]', params = 'masseVolumique', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Point d\'auto-inflammation|T° d\'auto-inflammation]]', params = 'TAutoInflammation', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Point d’éclair]]', params = 'pointEclair', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Limite d\'explosivité|Limites d’explosivité dans l’air]]', params = 'limitesExplosivite', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Pression de vapeur saturante]]', params = 'pressionVapeur', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Viscosité dynamique]]', params = 'viscosite', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Point critique (thermodynamique)|Point critique]]', params = 'pointCritique', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Point triple]]', params = 'pointTriple', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Conductivité thermique]]', params = 'conductivitéThermique', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Conductivité électrique]]', params = 'conductivitéÉlectrique', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Vitesse du son]]', params = 'vitesseSon', styleHeader = 'background: #EEEEEE; padding: 2px 7px'}
}
},
helper.table_n{ text = 'Thermochimie', background = '#ffdead',
{ helper.mixed_n{label = '[[Entropie molaire standard|S°gaz, 1 bar]]', params = 'emsGaz', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = 'S°liquide, 1 bar', params = 'emsLiquide', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = 'S°solide', params = 'emsSolide', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Enthalpie standard de formation|ΔfH°gaz]]', params = 'esfGaz', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = 'ΔfH°liquide', params = 'esfLiquide', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = 'ΔfH°solide', params = 'esfSolide', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Enthalpie de fusion]]', params = 'enthFus', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Enthalpie de vaporisation]]', params = 'enthVap', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = '[[Capacité thermique]]', params = 'capaciteTherm', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = 'PCS', params = 'PCS', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
helper.mixed_n{label = 'PCI', params = 'PCI', styleHeader = 'background: #EEEEEE; padding: 2px 7px'},
}
},
helper.table_n{ text = 'Précautions', background = '#FFB4B4',
{ helper.doubled_n{label = '[[NFPA 704]]', params = 'NFPA704', styleHeader = 'background: #EEEEEE; text-align: center', value = function() return dispNFPA704( ) end},
}
},
helper.table_n{ text = 'Unités du [[Système international d\'unités|SI]] et [[Atmosphère normalisée|CNTP]], sauf indication contraire.', background = '#ffdead',
},
}
}