Add a moc of figure.generate_widget