What factors influence a star's temperature and density?
For main sequence stars there is not much choice. If you pick mass, then all the rest is determined; any variation you see is due to different chemistry (thus fractions of different elements).
For the main sequence one generally assumes that $L \propto M^{3.5}$ and $R \propto M^{2/3}$ (and similarily the density is given for a given mass). The Hertzsprung-Russel diagramme is expression of this.
Any stars not on the main sequence, be that the white dwarfs or any giants, are there due to their peculiar chemistry. White dwarfs are degenerate stellar remanents, slowly cooling. The giants have evolved away from main sequence. They have some other fusion process(es) than hydrogen burning in their core so that their luminosity is much bigger than hydrogen-burning stars; at least they have a hydrogen-depeleted and helium-enriched core and started hydrogen-shell burning.