Right now, the Graph View button shows, whether there's a graph or not. A graph only occurs if there are statements (triples) which include a topic.
It should be possible to to test the graph data. If it is empty "[]", then a flag is not made true; otherwise, a flag is made true which then satisfies an {{#if flag}} in the template