The use of topology to derive chemically-intuitive quantities from first-principles calculations is an important part of strengthening the link between quantum mechanics and chemistry. However, it is also important to be able to move in the other direction -to be able to incorporate chemical ideas into first-principles calculations. Ideally, one would be able to set up a feedback loop whereby chemically-intuitive quantities can be calculated from first-principles and fed back into the calculation to improve the results. This work investigates one route to achieving this for density functional theory (DFT) calculations, by providing a method to calculate topological properties of functions defined on a real-space integration grid. This is achieved by the construction of a neighbourhood graph over the DFT gridpoints and it is demonstrated that intrinsic properties of the graph, such as maximal spanning trees and strongly-connected subgraphs, correspond to chemically-relevant properties. Having such topological information available on a pergridpoint basis allows for its direct incorporation into DFT calculations.